shadow question

if someone can help with this i would appreciate it.

say i have a model and i want to draw a shadow of the model just “below” the model such that it appears that a light is above the model and shadow is projected onto a plane. since, the model may be rotated, etc. i want the shadow to reflect the orientation of the model.

can anyone give me a hint as how to proceed?

thanks

There are standard techniques for this kind of stuff. Look into shadow mapping and stencil shadows.

Beyond those, google “planar projected shadows”. Depends on all your requirements which one you should go with.

You didnd’t ask for it, but consider the possibility to use a more simple form of shadows. It is quite easy to update the shader so as to simply add some circular darkness beneath the object. This doesn’t meet your requirement of “shadow is projected onto the plane”, but it is very simple and use less GPU resources. It is also an alternative to offer if you want to support graphic cards that are not as powerful.