webglstudio.js icon indicating copy to clipboard operation
webglstudio.js copied to clipboard

How to animate a model to turn to a position such that it always shows a particular side of the model?

Open KnightCoder opened this issue 5 years ago • 1 comments

Lets say that I've a model of an animal and the user rotates the animal in any direction but once the user clicks a button "Turn to show face" the 3D model should animate turning to show the animal's face, no matter in which angle it was rotated previously by the user.

How can I achieve this? Is there a function/property where we can set lets say the absolute angle (not relative angle) value?

KnightCoder avatar Apr 29 '20 18:04 KnightCoder

I noticed a transform.orientTo method. I even tried this it turned the model but it didn't animate the turning. Is this method correct? If yes, how can I make it animate the turn? Can you please give a short example?

KnightCoder avatar Apr 29 '20 21:04 KnightCoder