<p>Thanks for notification me, In my previous answer, I just combine the translation matrix and the rotation matrix, actually, It's the result translation matrix(T) multiply rotation matrix(R). </p>

<p>The rotation is a 3x3 matrix, we can extend the matrix to a 4x4 matrix with adding a dimension, the 4x4 rotation matrix is:</p>

<p><a href="https://i.sstatic.net/QOZur.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QOZur.gif" alt="enter image description here"></a></p>

<p>And the translation matrix is:</p>

<p><a href="https://i.sstatic.net/l3FFz.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/l3FFz.gif" alt="enter image description here"></a></p>

<p>So, now we can calculate the transform matrix by translation matrix multiply(T) rotation matrix(R):</p>

<p>Cause the matrix multiply formula is too big for the 4x4 matrix, we just look at the 1st row, In the transform matrix(M), the M11 element equals to T11*R11+T12*R21+T13*R31+T14*R41, cause T12, T13, R41 is 0, so, the M11 equals to R11 right? And in the same way, M14 equals to T11*R14+T12*R24+T13*R34+T14*R44, only R44 equals to 1, so, the M14 equals to T14. so, I just simply put them together in my last answer. For the reason why we put the translation matrix on the left, you can check on the book that I gave you in my previous answer on page 91(translating first and then rotating).</p>

CC BY-SA 3.0
2017-03-29T10:09:35.977Z
Great, so we both agree we have to multiply the rotation and translation matrices. I'm going to have to check with my lecturer though which order to do it. He also multiplies the last column of the final transformation matrix (M) by -1 (except for the 1 in M44). Thanks anyways.
S.A
CC BY-SA 3.0
2017-03-29T10:12:55.893Z
Can you share the result after checking with your lecturer. Thanks.
Craig.Li
CC BY-SA 3.0
2017-03-29T12:03:53.283Z
Yeah, once I get it sure.
S.A
CC BY-SA 3.0
2017-08-05T21:34:31.123Z
As this question is being closed as a duplicate of the [first half](https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices), I've copied and pasted this answer from here to there, with minor adjustment to make it fit as a second half of your original answer there. You may need to make minor edits if I've accidentally changed your intention.
trichoplax is on Codidact now
CC BY-SA 3.0
2017-03-29T09:02:43.823Z
2017-03-29T09:02:43.823Z
Craig.Li
<blockquote>
  <p>For a 3D scene in the world coordinates, its <em>View Reference Point</em> $\mathrm{VRP}$ is at $(5,2,1)$, and a viewer is looking towards point $A=(1,1,1)$. Construct a transform matrix which will map  world  coordinate  points  to  a  right-handed  $(UVN)$  viewing  space,  so  that  VRP  is 
  the  origin,  the  line  joining  $\mathrm{VRP}$ to  $A$  is  the  positive  $N$  axis,  and  the  view-up  Vector  is $(0,0,1)$.  </p>
</blockquote>

<p>I have calculated the translation matrix:</p>

<p>$$
T=
\begin{pmatrix}
1 &amp; 0 &amp; 0 &amp; -5 \\
0 &amp; 1 &amp; 0 &amp; 2 \\
0 &amp; 0 &amp; 1 &amp; -1 \\
0 &amp; 0 &amp; 0 &amp; 1 \\
\end{pmatrix}
$$</p>

<p>I have calculated the rotation matrix:</p>

<p>$$
R=
\begin{pmatrix}
-0.6 &amp; -0.8 &amp; 0 &amp; 0 \\
0 &amp; 0 &amp; 1 &amp; 0 \\
-0.8 &amp; 0.6 &amp; 0 &amp; 0 \\
0 &amp; 0 &amp; 0 &amp; 1 \\
\end{pmatrix}
$$</p>

<p>But what would the final transformation matrix $M$ be? My lecture slides tell me it would be rotation matrix multiplied by translation matrix, with the last column multiplied by $-1$ except for the $1$. This would equal:</p>

<p>$$
M = R \times T = 
\begin{pmatrix}
-0.6 &amp; -0.8 &amp; 0 &amp; -1.4 \\
0 &amp; 0 &amp; 1 &amp; 1 \\
-0.8 &amp; 0.6 &amp; 0 &amp; -5.2 \\
0 &amp; 0 &amp; 0 &amp; 1 \\
\end{pmatrix}
$$</p>

<p>But this answer here: <a href="https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices">Building view transform matrices</a></p>

<p>just adds them together somehow. Which one is correct?</p>

CC BY-SA 3.0
2017-08-05T21:33:42.117Z
As this question is being closed as a duplicate of the [first half](https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices), I've copied and pasted the wording from here to there, with minor adjustment to make it fit as a second half. You may need to make minor edits if I've accidentally changed your intention.
trichoplax is on Codidact now
<3d><matrix><linear-algebra>
Final transformation matrix to transform world coordinate into vrc
S.A
# Final transformation matrix to transform world coordinate into vrc

(Asked by: username_0 on 2017-03-27)

> For a 3D scene in the world coordinates, its *View Reference Point* $\mathrm{VRP}$ is at $(5,2,1)$, and a viewer is looking towards point $A=(1,1,1)$. Construct a transform matrix which will map world coordinate points to a right-handed $(UVN)$ viewing space, so that VRP is
> the origin, the line joining $\mathrm{VRP}$ to $A$ is the positive $N$ axis, and the view-up Vector is $(0,0,1)$.

I have calculated the translation matrix:

$$
T=
\begin{pmatrix}
1 & 0 & 0 & -5 \\
0 & 1 & 0 & 2 \\
0 & 0 & 1 & -1 \\
0 & 0 & 0 & 1 \\
\end{pmatrix}
$$

I have calculated the rotation matrix:

$$
R=
\begin{pmatrix}
-0.6 & -0.8 & 0 & 0 \\
0 & 0 & 1 & 0 \\
-0.8 & 0.6 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{pmatrix}
$$

But what would the final transformation matrix $M$ be? My lecture slides tell me it would be rotation matrix multiplied by translation matrix, with the last column multiplied by $-1$ except for the $1$. This would equal:

$$
M = R \times T =
\begin{pmatrix}
-0.6 & -0.8 & 0 & -1.4 \\
0 & 0 & 1 & 1 \\
-0.8 & 0.6 & 0 & -5.2 \\
0 & 0 & 0 & 1 \\
\end{pmatrix}
$$

But this answer here: [Building view transform matrices](https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices)

just adds them together somehow. Which one is correct?

**Tags:** 3d, matrix, linear-algebra

> **Comments:**
> **username_1**: As this question is being closed as a duplicate of the [first half](https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices), I've copied and pasted the wording from here to there, with minor adjustment to make it fit as a second half. You may need to make minor edits if I've accidentally changed your intention.  

---

## 1 answers

### Answer by username_2 on 2017-03-29. Score: 0

Thanks for notification me, In my previous answer, I just combine the translation matrix and the rotation matrix, actually, It's the result translation matrix(T) multiply rotation matrix(R).

The rotation is a 3x3 matrix, we can extend the matrix to a 4x4 matrix with adding a dimension, the 4x4 rotation matrix is:

[![enter image description here](https://i.sstatic.net/QOZur.gif)](https://i.sstatic.net/QOZur.gif)

And the translation matrix is:

[![enter image description here](https://i.sstatic.net/l3FFz.gif)](https://i.sstatic.net/l3FFz.gif)

So, now we can calculate the transform matrix by translation matrix multiply(T) rotation matrix(R):

Cause the matrix multiply formula is too big for the 4x4 matrix, we just look at the 1st row, In the transform matrix(M), the M11 element equals to T11\*R11+T12\*R21+T13\*R31+T14\*R41, cause T12, T13, R41 is 0, so, the M11 equals to R11 right? And in the same way, M14 equals to T11\*R14+T12\*R24+T13\*R34+T14\*R44, only R44 equals to 1, so, the M14 equals to T14. so, I just simply put them together in my last answer. For the reason why we put the translation matrix on the left, you can check on the book that I gave you in my previous answer on page 91(translating first and then rotating).

> **Comments:**
> **username_0**: Great, so we both agree we have to multiply the rotation and translation matrices. I'm going to have to check with my lecturer though which order to do it. He also multiplies the last column of the final transformation matrix (M) by -1 (except for the 1 in M44). Thanks anyways.  
> **username_2**: Can you share the result after checking with your lecturer. Thanks.  
> **username_0**: Yeah, once I get it sure.  
> **username_1**: As this question is being closed as a duplicate of the [first half](https://computergraphics.stackexchange.com/questions/4737/building-view-transform-matrices), I've copied and pasted this answer from here to there, with minor adjustment to make it fit as a second half of your original answer there. You may need to make minor edits if I've accidentally changed your intention.  

---

