?
Solved

Translucent Sphere

Posted on 2003-10-22
8
Medium Priority
?
614 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 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 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