One more pseudo-stencilShadow code ...

Blitz3D Forums/Blitz3D Programming/One more pseudo-stencilShadow code ...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is great. I wonder if it's hard to create shadow volumes on the fly for any mesh, including animated ones. Maybe there is some kind of formula that takes the light-to-mesh relation pitch/yaw and roll and returns the required scaling factors for the meshes copy that will be the basement for the shadow volume?

I really like this method since it's using only built in commands.

EDIT: I think you need to scale (stretch) the meshes on the vertex level, so you can move the vertices contrary the lights direction. Begin with the vertex that is closest to the light, this one has to stay where it is. all other vertices should be moved away from the light, depending on their distance to the meshes center. However, this requires realtime mesh deformation and may be pretty slow.