Three.js Rotation Timer

34 Views Asked by At

I am attempting to make an object rotate in three.js. However, my goal isn't that simple. I know how to make an object rotate, but what I want is for it to rotate for a certain amount of time instead of just indefinitely.I am not sure how to do this.

Rotation is "this.rotation.(x, y or z) += 0.1"

Does anyone know how to code what I want to do?

1

There are 1 best solutions below

0
Nephelococcygia On

The approach by frame for animation is kind of complicated to start with IMO, as you need to abstract a lot variables and logics.

What you can do instead, is to use "imperative animations", known as "tween".

You can find an example in the source code of this demo.