<p>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 <span class="math-container">$m_1$</span> is defined wrt the coordinate system <span class="math-container">$W$</span>. And you have some other coordinate system <span class="math-container">$L$</span> and want to find the positions of the points of <span class="math-container">$m_1$</span> in it. To do this you need to multiply each of your points with the matrix used to go from <span class="math-container">$W$</span> to <span class="math-container">$L$</span>. To build this matrix you need to know the coordinates of the basis vectors of <span class="math-container">$W$</span> wrt <span class="math-container">$L$</span>. Then you can make a 3x3 matrix where each column is a basis vector with which you can go from <span class="math-container">$W$</span> to <span class="math-container">$L$</span>. Note that a translation will also be necessary if the origins do not agree.
The solution for <span class="math-container">$m_2$</span> is similar.</p>

CC BY-SA 4.0
2019-02-07T13:18:45.080Z
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 ?
Mohamed Benmahdjoub
CC BY-SA 4.0
2019-02-07T13:22:48.410Z
What coord system is $m_2$ define in to begin with?
lightxbulb
CC BY-SA 4.0
2019-02-07T13:23:27.787Z
in the World coordinate system `W`
Mohamed Benmahdjoub
CC BY-SA 4.0
2019-02-07T13:29:59.537Z
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
CC BY-SA 4.0
2019-02-07T13:15:14.813Z
2019-02-07T13:15:14.813Z
lightxbulb
<p>Suppose we have a world coordinate system <code>W</code> and a 3D model <code>m1</code> defined in <code>W</code>. <code>m1</code> has its own local coordinate system <code>L</code>.</p>

<ol>
<li>How would we define <code>L</code>? Only by the transform from <code>W</code> to the object?</li>
</ol>

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

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

CC BY-SA 4.0
2019-02-07T12:39:25.810Z
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
CC BY-SA 4.0
2019-02-07T13:16:46.087Z
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 ?
Mohamed Benmahdjoub
<transformations>
Define position and orientation in a local coordinate system
Mohamed Benmahdjoub
# Define position and orientation in a local coordinate system

(Asked by: username_0 on 2019-02-07)

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 ?

**Tags:** transformations

> **Comments:**
> **username_1**: 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?  
> **username_0**: 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 ?  

---

## 1 answers

### Answer by username_2 on 2019-02-07. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: 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 ?  
> **username_2**: What coord system is $m_2$ define in to begin with?  
> **username_0**: in the World coordinate system `W`  
> **username_2**: 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.  

---

