Solved

Translucent Sphere

Posted on 2003-10-22
8
612 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 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 125 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
Technology Partners: 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

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!

Question has a verified solution.

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

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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