Advertisement

Shadow Code, making a sphere ...

Started by November 26, 2000 08:51 PM
1 comment, last by BeyondDeath 23 years, 11 months ago
How could I modify the shadow code to make a sphere, or other shape like a teapot etc cast a shadow without loading everything from a file Thanks allot
Unfortunately you won''t be able to use gluQuadric. You need to be able to get the vertices of all the triangles in the shape and construct the connection and plane information.

If you use a model loader of some form, you can easily store its data in a structure just like ShadowedObject, and work from that.

If you are jsut interested in a sphere for now, have a look at GLUT - I believe it has a glutSphere method. You could use the code from this to generate your triangles, and enter them into the SahdowedObject structure.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
Advertisement
You can perhaps use a different algorithm - projective shadows. Goto nvidia and download the document about the stencil buffer by Mark Kilgard.

This topic is closed to new replies.

Advertisement