Shadows

Blitz3D Forums/Blitz3D Programming/Shadows

Sure... here's what it does.

1. Make a towel. This is a quad mesh. That is, a mesh that has rows and columns. David Bird's code was used for this in the CreateQuad function. It's given these rows and columns so that it may deform effectively.

2. Imagine a towel? you can throw it over anything and it should lie on the surface flat pretty well. This is how the shadow routines work.

We position the flat mesh high above where it is due to land, then throw it onto the floor by using a linepick at each vertex. Then we use PickedY() to get the height of the floor where that vert will go.

3. And thats it. Basically, the idea is to deform a detailed square blanket, or towel so it fits on any floor. And repeat this procedure every loop.

There are other ways of doing it I suppose...