samedi 14 avril 2018

Moving an obj randomly in THREE.js

and sorry for my English, i'll try my best!

I'm stuck with a problem in THREE.js. I want to animate a shark in the sea, and it should swim in random direction.

My problem is: how can i get its direction which is moving ? I want to make it moved in a range [-x,+x] [-z, +z]. When an edge is reached, it should turn back, something like a rotationY of 180 °.

Thanks for your answers!




Aucun commentaire:

Enregistrer un commentaire