Solved

Translucent Sphere

Posted on 2003-10-22
8
604 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
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now