Physics element surface catch shadows


(Pete) #1

I was working on a project where a basketball bounces up down and tried to manually create shadow and thought wouldn’t it be great if the ball had a shadow while bouncing to get that realistic sense within the physics api?

Could this be done with JavaScript?

Also since I don’t see the physical ball bouncing in the timeline I can’t really manually create a shadow.


(Mark Hunte) #2

Probably,

I would think you can observe the position of the ball in the scene.
And have another ellipse follow it on a single plane ( left position ) And depending onthe balls top the ellipse would shrink/grow and fade/darken


(Loves Hype) #3

Limited to one plane:
3D-Shadow.hype.zip (50,4 KB)


(Nick ) #4

Really Nice!!


(Pete) #5

Thank you Max. I just msged you, pls take a look.


(Loves Hype) #6

Here is a version that includes a function to stop the shadow following
3D-Shadow 2.hype.zip (56,5 KB)

The destroy() function is on a button but can also be called via the timeline.

I called the functions init and destroy but startFollowShadow and stopFollowShadow would be much more explanatory… but as long as it works. Next time :wink: