# Define position and orientation in a local coordinate system

Suppose we have a world coordinate system W and a 3D model m1 defined in W. m1 has its own local coordinate system L.

1. How would we define L? Only by the transform from W to the object?

If we add a 3D model m2 to W : How do we define its position and orientation in L without worrying about the world coordinate system. Like just saying for instance that it's in (0,0,0) in L?

PS : If it's possible using algebraic or 3D geometry matrices transformation equations ?

• I don't quite understand your question. In the local coordinate system (of each object) the object is assumed to be at the origin. This local origin can be any point in the world space though. You then need to construct a transformation matrix to go between world-local. Are you perhaps asking how to construct this matrix? – gallickgunner Feb 7 '19 at 12:39
• Thanks for the comment. Yeah ! I would want to know that ! and also I meant if I wanted to put m2 in (1,1,1) of L how would I do that ? – Calips Feb 7 '19 at 13:16

Assuming that your 'models' can be represented by collections of points, then these points' coordinates are defined with respect to some coordinate system. You said that $$m_1$$ is defined wrt the coordinate system $$W$$. And you have some other coordinate system $$L$$ and want to find the positions of the points of $$m_1$$ in it. To do this you need to multiply each of your points with the matrix used to go from $$W$$ to $$L$$. To build this matrix you need to know the coordinates of the basis vectors of $$W$$ wrt $$L$$. Then you can make a 3x3 matrix where each column is a basis vector with which you can go from $$W$$ to $$L$$. Note that a translation will also be necessary if the origins do not agree. The solution for $$m_2$$ is similar.
• Thanks for the answer ! my question would be then how to say where is m2 wrt L where L is the local coordinate system of m1, or if I wanted to put m2 in (1,1,1) of L How would I proceed ? – Calips Feb 7 '19 at 13:18
• What coord system is $m_2$ define in to begin with? – lightxbulb Feb 7 '19 at 13:22
• in the World coordinate system W – Calips Feb 7 '19 at 13:23
• Then you transform it the same way as you do $m_1$. You need $W$'s basis vectors expressed in $L$, and then build a matrix with the columns being those vectors. Then multiply the points of $m_2$ with it. You may also need to translate in case the origins of $L$ and $W$ are not the same. – lightxbulb Feb 7 '19 at 13:29