Skip to main content
GameDev.net gamedev.net
🔒 Locked

Aligning shadows with terrain

Started by SHilbert Feb 29, 2000 at 4:08 PM 0 replies 600+ views
Original Post
SHilbert
SHilbert
I''m writing a flight sim, and I''m trying to get the shadow of the plane to map onto the terrain. (If it helps, the shadow is a textured square w/ transperency FX.) Is there any simple (or at least not overly complex) way to do this?
Spellbound
Spellbound
Find the triangles that might will be shadowed by the texture. You do this by parallell projecting the shadow texture and checking if the triangle is inside the frustum that the parallell projected edges make up.

Then apply the shadow texture on these, where you use the parallell projection to find the texture coordinates.

The vector that is used for the parallell projection is the light vector from the sun.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.