Jump to content
  • Advertisement
Sign in to follow this  

basic shadows

This topic is 4955 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

For a project I am doing, I have a height map which has trees scattered across the ground. There is also a car that can drive across the ground. My problem is that I need to have the trees cast shadows onto the terrain. There is a specific way I've been asked to do this (bear with me, I swear I am not asking anybody to do my homework for me). In order to avoid the complexities of having to cast a shadow onto the curved terrain, we are to first render the shadows (cast by the moving sun) to a flat plane of size (64x3)x(64x3). The actual height map is 64x64, so we are supposed to average the color values for a 3x3 square from that plane, and darken the appropriate point on the heightmap when rendering in order to create the appearance of a shadow. I've been able to successfully render the tree and car shadows to a plane using glMultMatrixf(). What I can't figure out is how to render that plane to a 2dimensional view so that I can pull out the shadow information. I think I need to use the ortho view, and maybe set the camera so it is looking directly down on the shadows from the positive Y axis, but what i cant figure out is how to make sure the entire map fits neatly into this (192x192) grid so i can just copy the information out as a bitmap. Could someone please help me out? I've been at this for quite some time. Any help is greatly appreciated. -Mike Quinn

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!