0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Also, I'm not sure I understand what the right, up and forward vectors represent (I know it's linked to x, y, z axes but don't see exactly how these fit). $\endgroup$ – Nik-Lz Feb 7 at 11:19
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.