With a rotated object in my scene, how can I translate a global vector into the local space of that rotated object, so that they are rendered in the same spot of the global vector?
Take for example a cube that is rotated but at the global origin. Now I would like to render lines for each global dimension (x, y, z), but added as children to the rotated cube, not the global scene. How do I calculate and in three.js implement the rotation of those vectors so they will line up?
object.worldToLocal( vector )
what you are looking for? – WestLangleyvar translatedAxis = myRotatedObject.worldToLocal(new THREE.Vector3(1, 0, 0));
– konturparent.updateMatrixWorld(); // important!
was the crucial missing piece. Feel free to add a reference to that as an answer and I'll gladly accept. :) – kontur