We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi
I'm currently doing an interactive installation where we need to create a shadow. We're tracking a person using a kinect and that person acts as the lightsource in a room. In the room there's a object that we want to cast a "fake" shadow. see sketch:
(the dashed lines is just there to show from where the light emits)
I can't seem to wrap my head around how to do it. I found a very old processing sketch which does just about what I want, but it's far too complex for me to understand. http://gbs.ebridde.is/deadguy/shadows/
Hope that you're able to help
Thank you
Answers
Is this example 2D or 3D? Are you using the P3D renderer in your sketch?
Just 2D. I'm using P2D
So it's not a "real" rendering of the shadow, just a shape that acts like a shadow.
@snorge --
Is the object in the room an ellipse, or is it more complex?
If you can model the object as a circle (or an object on a circular pedestal!) then the problem you depict in your illustration is finding the "tangent lines to two circles".
Here is a simple example to get started which uses a public Java class that returns the tangent lines.
To cast a shadow instead, you will want to project those line segments from their intersection points.
Thank you @jeremydouglass it helped a lot!
Very glad that it was helpful, @snorge
If you were able to figure out the 2D shadow casting, please consider sharing your solution with the forum.
cool
For circular shapes, it may be fairly easy. But what about arbitrary shapes? Has anyone figured that out?