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);





updated the post with what I have so far. It doesn't do the trick though
– SnakesCantWearBoots
Aug 21 at 17:47





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.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

How do I collapse sections of code in Visual Studio Code for Windows?