PDA

View Full Version : shadow



lqiao
10-27-2000, 01:08 PM
How to produce a shadow of 3D object(such as cube) with respect to light?
Is there any algorithm to deal with that problem? or does there exist a set of function in opengl to solve that problem?

10-27-2000, 01:58 PM
no nothing is built in, but if you do a search here I think you will find an anser

Glossifah
10-27-2000, 07:17 PM
Search www.nvidia.com (http://www.nvidia.com) in the developer section. Mark Kilgard wrote a white paper on stencil buffering (VGIMO), and it has a rather large section dealing with shadow generation using stencil. Granted, the shadows using this technique aren't near what you would get with raytracing/casting or some other algorithm, but it will be realtime (assuming you have a card that supports 1/8/16 stencil bits).

Have a look and pull down some of the Nvidia demos/source as well.

Enjoy!

Glossifah

Spaceman
10-28-2000, 05:00 AM
I haven't tested it yet but i think you can create a shadow with the glScale function.
A scale value of zero collapses all object coordinates along that axis to zero.