Change object axes on rotation Threejs
Change object axes on rotation Threejs
This has probably been asked, but I haven't found an answer yet.
Is it possible to rotate object with it's axes? By that I mean, can you, for example, have a person model, and have it's face "look" straight where the z axis is, then rotate that person around y axis for some degrees and now for that object z axis still be straight where he "looks"/faces?
if(left)
cube.rotateOnAxis(new THREE.Vector3(0, 0.25, 0), Math.PI/16);
else if(right)
cube.rotateOnAxis(new THREE.Vector3(0, -0.25, 0), Math.PI/16);
have you looked into quaternions? threejs.org/docs/#api/math/Quaternion
– PerrinPrograms
Aug 21 at 17:47
damn, that's a hell of a rabbit hole I'm getting myself in to. Thank you
– SnakesCantWearBoots
Aug 21 at 17:54
haha. No problem, good luck!
– PerrinPrograms
Aug 21 at 17:58
The axis should be a normalized vector.
– prisoner849
Aug 21 at 18:05
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
updated the post with what I have so far. It doesn't do the trick though
– SnakesCantWearBoots
Aug 21 at 17:47