View Full Version : shadow
10-27-2000, 02: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?
no nothing is built in, but if you do a search here I think you will find an anser
10-27-2000, 08: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.
10-28-2000, 06: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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.