How to rotate a Three.js Vector3 by a certain angle around an axis?
js suggest the way to rotate an object around a point using three. js is to create a parent object at the position you want to rotate around, attach your object, and then move the child. Then when the parent is rotated the child rotates around the point.
Class representing a 3D vector. A 3D vector is an ordered triplet of numbers (labeled x, y, and z), which can be used to represent a number of things, such as: A point in 3D space.
var vector = new THREE.Vector3( 1, 0, 0 ); var axis = new THREE.Vector3( 0, 1, 0 ); var angle = Math.PI / 2; vector.applyAxisAngle( axis, angle );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With