To truly grasp this concept, it is essential to shift your focus from programming to linear algebra. Understanding the core definition of a Vector
and what it represents is crucial.
A common misconception is viewing a Vector
as simply a point in 3D space (x,y,z). This oversimplification hinders the ability to work with vectors effectively in spatial scenarios, leading to confusion like the one presented here.
For more information and resources on vectors and spaces visit:
Explore vector introduction in linear algebra at:
When copying object rotation, utilize
obj2.rotation.set(obj1.rotation.x,obj1.rotation.y,obj1.rotation.z)
.
To place an object relative to another object's orientation, consider using the second object as a parent:
var my_vect = new THREE.Object3D(); // create a vector
obj1.add(my_vect); // add it to your object
obj1.rotation.set(1,2,3); // rotate the object
my_vect.position.translateX(1); // move the vector 1 unit ahead of the object
obj1.localToWorld( my_vect.position); // transform local coordinates into global coordinates
In essence, my_vect.position.x, my_vect.position.y, my_vect.position.z represent the positional values before considering the object's orientation within your scene.