Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BeyondDeath

Shadow Code, making a sphere ...

This topic is 6505 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can perhaps use a different algorithm - projective shadows. Goto nvidia and download the document about the stencil buffer by Mark Kilgard.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!