Sometimes, we want to rotate a mesh by 90 degrees in Three.js and JavaScript.
In this article, we’ll look at how to rotate a mesh by 90 degrees in Three.js and JavaScript.
How to rotate a mesh by 90 degrees in Three.js and JavaScript?
To rotate a mesh by 90 degrees in Three.js and JavaScript, we set the rotation.x
property of the mesh.
For instance, we write
mesh.rotation.x = Math.PI / 2;
to rotate the mesh by 90 degrees, which is Math.PI / 2
radians.
Conclusion
To rotate a mesh by 90 degrees in Three.js and JavaScript, we set the rotation.x
property of the mesh.