<p>For others who might have this question, here a perhaps more straight forward numeric answer (I'm now working myself on this book as well). Consider that:</p>

<ol>
<li><p>We are given object space coordinates that need to be transformed into upright and subsequently world space coordinates.</p></li>
<li><p>We know that a vector <span class="math-container">$\vec{v}$</span> can be represented as a linear transformation of its axises in relation to the set of basis vectors <span class="math-container">$\vec{p}$</span>, <span class="math-container">$\vec{q}$</span>, <span class="math-container">$\vec{r}$</span>, when these are <strong><em>orthonormal</em></strong> (perpendicular to each other and with length <span class="math-container">$l = 1$</span>)</p></li>
<li><p>The equation to represent this is thus: <span class="math-container">$\vec{v} = v_{x}p + v_{y}q + v_{z}r$</span> </p></li>
<li><p>Given the basis vectors we can computed this for each object reference using the above equation. So, the first example would be:</p></li>
</ol>

<p><span class="math-container">$\vec{u} = -1 \begin{bmatrix}0.866\\ 0\\ -0.500 \end{bmatrix} + 2 \begin{bmatrix}0\\ 1\\ 0\end{bmatrix} + 0 \begin{bmatrix}0.500\\ 0\\ 0.866\end{bmatrix} = \begin{bmatrix}-0.866\\ 2\\ 0.500\end{bmatrix}$</span></p>

<p>Then, to compute this in world space, you simply need to add your world space reference to the upright vector. Meaning:</p>

<p><span class="math-container">$\vec{w} = o + u$</span></p>

<p>For the first example in the book that would be:</p>

<p><span class="math-container">$\vec{w} = \begin{bmatrix}1\\ 10\\ 3\end{bmatrix} + \begin{bmatrix}-0.866\\ 2\\ 0.500\end{bmatrix} = \begin{bmatrix}0.134\\ 12\\ 3.500\end{bmatrix}$</span></p>

CC BY-SA 4.0
2019-05-07T10:45:00.733Z
2019-05-07T10:45:00.733Z
Darien Brito
<p>Let me try to translate the problem statement in a mathematical way so that it can be understood more easily.</p>

<blockquote>
  <p>Assume that the robot is at the position (1, 10, 3)</p>
</blockquote>

<p>Assume there are a set of basis <span class="math-container">$\mathbf{e}_i$</span> and origin <span class="math-container">$\mathbf{O}$</span>, then the robot position <span class="math-container">$\mathbf{P}$</span> expressed in this basis is the origin plus a linear combination of the basis and the coefficients <span class="math-container">$\mathbf{p}=(1,10,3)$</span>:
<span class="math-container">$$\mathbf{P}=p_i \mathbf{e}_i + \mathbf{O}$$</span></p>

<blockquote>
  <p>and her right, up, and forward vectors expressed in upright space are [0.866, 0, −0.500], [0, 1, 0], and [0.500, 0, 0.866], respectively.</p>
</blockquote>

<p>Now we have another set of basis denoted as <span class="math-container">$\mathbf{e}'_i$</span> attached at <span class="math-container">$\mathbf{P}$</span>, and the relation between these two basis <span class="math-container">$\mathbf{e}$</span> and <span class="math-container">$\mathbf{e}'$</span> are also expressed as linear combinations. That is, denote <span class="math-container">$\mathbf{m}_0=(0.866,0,-0.5)$</span>,<span class="math-container">$\mathbf{m}_1=(0,1,0)$</span>, and <span class="math-container">$\mathbf{m}_2=(0.5,0,0.866)$</span>, then
<span class="math-container">$$
\mathbf{e}'_i=m_{ij} \mathbf{e}_j
$$</span></p>

<blockquote>
  <p>Calculate the coordinates for these points in upright and world space. (a) (−1, 2, 0) (b) (1, 2, 0) ...</p>
</blockquote>

<p>The given coordinates are in object space and the problem asks us to compute their representations in frames <span class="math-container">$\{\mathbf{e}_i,\mathbf{P}\}$</span> and <span class="math-container">$\{\mathbf{e}_i,\mathbf{O}\}$</span> respectively.</p>

<p>Take <span class="math-container">$\mathbf{x}=(-1,2,0)$</span> as an example, we want to find the coordinates <span class="math-container">$\mathbf{l}$</span> in upright space:
<span class="math-container">$$
\begin{align}
x_i \mathbf{e}'_i + \mathbf{P} &amp;= l_i \mathbf{e}_i + \mathbf{P}\\
x_j m_{ji} \mathbf{e}_i &amp;= l_i \mathbf{e}_i
\end{align}
$$</span>
Written in matrix form: <span class="math-container">$\mathbf{M}^T \mathbf{x}=\mathbf{l}$</span>.</p>

<p>Next we find the coordinates <span class="math-container">$\mathbf{w}$</span> in world space:
<span class="math-container">$$
\begin{align}
x_i \mathbf{e}'_i + \mathbf{P} &amp;= w_i \mathbf{e}_i + \mathbf{O} \\
x_i \mathbf{e}'_i + p_i\mathbf{e}_i &amp;= w_i \mathbf{e}_i \\
x_j m_{ji} \mathbf{e}_i + p_i\mathbf{e}_i &amp;= w_i \mathbf{e}_i \\
x_j m_{ji} + p_i &amp;= w_i
\end{align}
$$</span>
Written in vector form:
<span class="math-container">$$
\mathbf{M}^T \mathbf{x} + \mathbf{p} = \mathbf{w}$$</span></p>

<p>Your idea is generally correct. And the "upright" matrix can be constructed by considering the relation (<span class="math-container">$m_{ij}$</span>) between the two basis, as shown above.</p>

CC BY-SA 4.0
2019-10-13T10:23:23.147Z
Thanks for the answer, but are you sure you haven't confused even yourself with so much symbolism (because I certainly have)? I did understand though. Thanks.
KeyC0de
CC BY-SA 4.0
2019-02-08T21:31:23.550Z
2019-02-08T21:57:34.983Z
2019-02-08T21:57:34.983Z
TheBusyTypist
<p>This is not homework. I'm self studying Computer Graphics, using the book "3D Math Primer for Graphics and Game Development" (2nd edition). So there is the exercise 6 in chapter 3 which I can't figure out how to solve exactly. It goes like this:</p>

<p>"Assume that the robot is at the position (1, 10, 3), and her right, up, and forward vectors expressed in upright space are [0.866, 0, −0.500], [0, 1, 0], and [0.500, 0, 0.866], respectively. (Note that these vectors form an orthonormal basis.) The following points are expressed in object space. Calculate the coordinates for these points in upright and world space.
(a) (−1, 2, 0) (b) (1, 2, 0)
..."</p>

<p>Now I know that in order to convert from Object space to world space I have to first convert into inertial/upright space by performing a rotation and then into world space by performing a translation. So I assume that that the point (1,10,3) is expressed in world space coordinates. What I don't understand is which one is the matrix I have to use to do the rotation on point (-1,2,0)? I understand conceptually what is going on but I don't know which operations to do here. Help is greatly needed and will be appreciated. Thanks in advance.</p>

CC BY-SA 4.0
2019-05-09T22:34:02.047Z
If you are having difficulties on the algebra side, I would like to suggest that you see 3Blue1Brown videos on linear algebra that are available on Youtube. They will give you all the geometric intuition you need to understand transformation matrices.
vgs
<transformations><affine-transformations>
How to convert from Object space into World space (exercise from 3D Math Primer book)
KeyC0de
# How to convert from Object space into World space (exercise from 3D Math Primer book)

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

This is not homework. I'm self studying Computer Graphics, using the book "3D Math Primer for Graphics and Game Development" (2nd edition). So there is the exercise 6 in chapter 3 which I can't figure out how to solve exactly. It goes like this:

"Assume that the robot is at the position (1, 10, 3), and her right, up, and forward vectors expressed in upright space are [0.866, 0, −0.500], [0, 1, 0], and [0.500, 0, 0.866], respectively. (Note that these vectors form an orthonormal basis.) The following points are expressed in object space. Calculate the coordinates for these points in upright and world space.
(a) (−1, 2, 0) (b) (1, 2, 0)
..."

Now I know that in order to convert from Object space to world space I have to first convert into inertial/upright space by performing a rotation and then into world space by performing a translation. So I assume that that the point (1,10,3) is expressed in world space coordinates. What I don't understand is which one is the matrix I have to use to do the rotation on point (-1,2,0)? I understand conceptually what is going on but I don't know which operations to do here. Help is greatly needed and will be appreciated. Thanks in advance.

**Tags:** transformations, affine-transformations

> **Comments:**
> **username_1**: If you are having difficulties on the algebra side, I would like to suggest that you see 3Blue1Brown videos on linear algebra that are available on Youtube. They will give you all the geometric intuition you need to understand transformation matrices.  

---

## 2 answers

### Answer by username_2 on 2019-05-07. Score: 2 | Accepted answer

For others who might have this question, here a perhaps more straight forward numeric answer (I'm now working myself on this book as well). Consider that:

1. We are given object space coordinates that need to be transformed into upright and subsequently world space coordinates.
2. We know that a vector $\vec{v}$ can be represented as a linear transformation of its axises in relation to the set of basis vectors $\vec{p}$, $\vec{q}$, $\vec{r}$, when these are ***orthonormal*** (perpendicular to each other and with length $l = 1$)
3. The equation to represent this is thus: $\vec{v} = v\_{x}p + v\_{y}q + v\_{z}r$
4. Given the basis vectors we can computed this for each object reference using the above equation. So, the first example would be:

$\vec{u} = -1 \begin{bmatrix}0.866\\ 0\\ -0.500 \end{bmatrix} + 2 \begin{bmatrix}0\\ 1\\ 0\end{bmatrix} + 0 \begin{bmatrix}0.500\\ 0\\ 0.866\end{bmatrix} = \begin{bmatrix}-0.866\\ 2\\ 0.500\end{bmatrix}$

Then, to compute this in world space, you simply need to add your world space reference to the upright vector. Meaning:

$\vec{w} = o + u$

For the first example in the book that would be:

$\vec{w} = \begin{bmatrix}1\\ 10\\ 3\end{bmatrix} + \begin{bmatrix}-0.866\\ 2\\ 0.500\end{bmatrix} = \begin{bmatrix}0.134\\ 12\\ 3.500\end{bmatrix}$


---

### Answer by username_3 on 2019-02-08. Score: 1

Let me try to translate the problem statement in a mathematical way so that it can be understood more easily.

> Assume that the robot is at the position (1, 10, 3)

Assume there are a set of basis $\mathbf{e}\_i$ and origin $\mathbf{O}$, then the robot position $\mathbf{P}$ expressed in this basis is the origin plus a linear combination of the basis and the coefficients $\mathbf{p}=(1,10,3)$:
$$\mathbf{P}=p\_i \mathbf{e}\_i + \mathbf{O}$$

> and her right, up, and forward vectors expressed in upright space are [0.866, 0, −0.500], [0, 1, 0], and [0.500, 0, 0.866], respectively.

Now we have another set of basis denoted as $\mathbf{e}'\_i$ attached at $\mathbf{P}$, and the relation between these two basis $\mathbf{e}$ and $\mathbf{e}'$ are also expressed as linear combinations. That is, denote $\mathbf{m}\_0=(0.866,0,-0.5)$,$\mathbf{m}\_1=(0,1,0)$, and $\mathbf{m}\_2=(0.5,0,0.866)$, then
$$
\mathbf{e}'\_i=m\_{ij} \mathbf{e}\_j
$$

> Calculate the coordinates for these points in upright and world space. (a) (−1, 2, 0) (b) (1, 2, 0) ...

The given coordinates are in object space and the problem asks us to compute their representations in frames $\{\mathbf{e}\_i,\mathbf{P}\}$ and $\{\mathbf{e}\_i,\mathbf{O}\}$ respectively.

Take $\mathbf{x}=(-1,2,0)$ as an example, we want to find the coordinates $\mathbf{l}$ in upright space:
$$
\begin{align}
x\_i \mathbf{e}'\_i + \mathbf{P} &= l\_i \mathbf{e}\_i + \mathbf{P}\\
x\_j m\_{ji} \mathbf{e}\_i &= l\_i \mathbf{e}\_i
\end{align}
$$
Written in matrix form: $\mathbf{M}^T \mathbf{x}=\mathbf{l}$.

Next we find the coordinates $\mathbf{w}$ in world space:
$$
\begin{align}
x\_i \mathbf{e}'\_i + \mathbf{P} &= w\_i \mathbf{e}\_i + \mathbf{O} \\
x\_i \mathbf{e}'\_i + p\_i\mathbf{e}\_i &= w\_i \mathbf{e}\_i \\
x\_j m\_{ji} \mathbf{e}\_i + p\_i\mathbf{e}\_i &= w\_i \mathbf{e}\_i \\
x\_j m\_{ji} + p\_i &= w\_i
\end{align}
$$
Written in vector form:
$$
\mathbf{M}^T \mathbf{x} + \mathbf{p} = \mathbf{w}$$

Your idea is generally correct. And the "upright" matrix can be constructed by considering the relation ($m\_{ij}$) between the two basis, as shown above.

> **Comments:**
> **username_0**: Thanks for the answer, but are you sure you haven't confused even yourself with so much symbolism (because I certainly have)? I did understand though. Thanks.  

---

