?
Solved

Translucent Sphere

Posted on 2003-10-22
8
Medium Priority
?
616 Views
Last Modified: 2013-12-26
Anybody can guide in how to draw a translucent sphere? Pls show my some code. Thanks.
0
Comment
Question by:KeithTeo
  • 3
  • 2
6 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9604451
Hi KeithTeo,

two things ... what platform/library?
is this your homework ?

Cheers!
Sunny:o)
0
 

Author Comment

by:KeithTeo
ID: 9625017
I'm working on Win2K using standard opengl library.

I understand that GLUquadricObj allows me to draw a spherical object and glColor4f allows me to draw an alpha object. But I still landed up with an opaque object. Why? Whats wrong? Can show me some code?

No. Its not my homework. Its just an interest.
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 9670248
Ok, you should find some code as well explanation here

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:effectstudios
ID: 9816471
well, I dont't have the code right now, but the problem is really simple. You first have to enable blending.


If that is all you need, please go ahead and skip the rest.

To understand this, you have to know just a couple of things.
1. Every geometric primitive that you draw, has finally to be represented on a raster - scan display, and thus all geometry is finally computed into pixels.

2. The entire 3D scene is projected onto a 2D plane, thus many objects end up overlapping each other.

3. When OpenGL is writing pixels to the frame buffer, it checks if a pixel is already there.
0
 
LVL 1

Expert Comment

by:effectstudios
ID: 9816486
(Sorry, pressed a couple of wrong keys!)

        a. if no, then it simply writes to the buffer.
        b. If yes, then it checks if the pixel in the buffer has come from a primitive that is closer to the camera than the current one. If the new one is closer, the value is overwritten, if the previous one is closer, then the new value is discarded.

4. However, this is in case of opaque objects, now suppose that you have to make something look transparent. In such a case, logic says that a pixel coming from the transparent/translucent primitive will not overwrite the previous pixel but change its colour (lets say in case of coloured glass). This modification of the colour of the previous pixel by the new one is termed blending.

Thus, you first have to enable blending. Then you select one of the various blending modes available and finally you precisely specify how you want the 'modification' to be done.

Regards
Vin
 
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10127238
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question