#Animation, Ball-Moving under diffrent conditions

4 messages · Page 1 of 1 (latest)

golden tundra
#

Hello dear Threejs-Community,
im new to threejs and trying to create a simple scene/animation.

My Goal:
• There is a ball which starts moving at the coordinate „x01“
• Once the ball reached the coordinate „x02“ its running up a ramp, where the gravitation-force is slowing him down
• When the ball reached the end of the ramp, the ball is flying „oblique throw“.

My Problem:
• I cant figure out how to set up the correct „if“ conditions, so when the ball moves and reaches a specific point „x02-coordinate“ it changes it moving direction.
o So if the ball starts to move in x-direction, i want the ball to change his move direction when it traveld a specific distance.

Ive set up all the equations, but i cant figure out to set up the movements changes correctly.

Ive attached a Schematic-Drawing, maybe it makes my issue more clear.

Thank you very much in advance. Have a nice evening/weekend.
Best Regards

pallid temple
edgy mountain
#

you can try also Cannon.js which is more easyer.