Sasith
Sasith

Reputation: 790

Three.js make object.rotation.x Smooth

I have .obj of logo that I load to a canvas using three.js. The logo is a part of a website loading section that I'm working. There is a 'Click to Enter' button on that section. All I want to do is when someone click on the enter button, logo to rotate 180 degrees vertically.

I'm using

var deg = Math.PI / 180 * 180;
object.rotation.x -= deg;

The logo rotation works, But it's not smooth. I want it be smooth(like transiton).

I really appreciate any help on this matter.
Also here is the link to the test page.

Thanks

Upvotes: 0

Views: 829

Answers (1)

Mugen87
Mugen87

Reputation: 31026

I suggest you use an animation library like tween.js in order to animate such transitions. This will also allow you to choose between different easing functions which will make your animation even more smooth.

Upvotes: 2

Related Questions