<p>All of these projections fall under the generic group of projections called &quot;Axonometric&quot; projections. The general goal of an axonometric projection is to manipulate the object using rotations and translations such that at least three adjacent faces of the projected object are shown. The result is projected from the center at infinity onto one of the coordinate planes usually the Z=0 plane. There are three common types of axonometric projections, trimetric, dimetric and isometric. With trimetric being the most general, dimetric is a specialization of trimetric with two of the three foreshortening factors being equal to each other, and isometric is a specialization of dimetric with the third foreshortening factor set equal to the other two (so all three are equal). Also note that the projection plane in this case is the Z plane. The matrix show below can be modified to use any of the X, Y or Z planes as the projection plane.</p>
<p>The general matrix form of all three (since dimetric and isometric are specializations of trimetric) is:</p>
<p><span class="math-container">\begin{bmatrix}
 &amp;cos\phi   &amp;sin\phi sin\theta  &amp;0 &amp;0 \\ 
 &amp;0  &amp;cos\theta  &amp;0 &amp;0 \\ 
 &amp;sin\phi  &amp;-cos\phi sin\theta  &amp;0 &amp;0 \\ 
 &amp;0  &amp;0  &amp;0 &amp;1 
\end{bmatrix}</span></p>
<p>Where phi is the rotation around the y axis and theta is the rotation around the x axis. The foreshortening length of each axis can be computed just by taking the sum of the squares of each row. Then take the square root to get the length. For the X axis this would be:</p>
<p><span class="math-container">\begin{equation}
f_{x}^{2} = cos^{2}\phi + sin^{2}\phi sin^{2}\theta
\end{equation}</span></p>
<p>A little bit of algebra will yield the values needed to compute the lengths of the other 2.</p>
<p>To determine a trimetric projection all we need are the two viewing angles. For a diametric or isometric view we need to set the foreshortening factors equal to either two or three of the axis. By using the lengths of the rows and setting them equal to one another then solving we can compute any of the values needed for either projection.</p>

CC BY-SA 4.0
2021-04-02T12:52:47.157Z
2021-04-02T12:52:47.157Z
pmw1234
<p>All of the above. If you look on matlabs page a little further down, it becomes apparent that matlab initializes a canvas (the screen), then looks for each pixel what is directly behind that screen. This gets rid of perspective. When you set the camera angle to 45 degrees down and 45 degrees left/right, you will get an implicit isometric projection. So really the "projection" just depends on your camera angle.</p>

<p>Sidenote: if you would want to keep a 3d perspective, you would need to draw the ray from the camera origin to the position on the canvas. That gives the ray the direction it needs to create perspective.</p>

CC BY-SA 4.0
2019-09-29T20:38:14.647Z
2019-09-29T20:38:14.647Z
AnnoyinC
<p>It's tricky because there are 2 non-uniform scales called "DataAspectRatio" and "PlotBoxAspectRatio". I worked through a simple case in <a href="https://www.mathworks.com/matlabcentral/answers/248362-screen-2d-projection-of-3d-plot" rel="nofollow noreferrer">the answer to this post</a>, but I'm afraid that doesn't cover all of the edge cases.</p>

CC BY-SA 4.0
2019-11-08T22:30:41.123Z
2019-11-08T22:30:41.123Z
MPG
<p>I would like to imitate the orthographic projection that Matlab uses by default:</p>

<p><a href="https://uk.mathworks.com/help/matlab/creating_plots/understanding-view-projections.html" rel="nofollow noreferrer">Matlab View Projections</a></p>

<p>and</p>

<p><a href="https://uk.mathworks.com/help/matlab/ref/camproj.html" rel="nofollow noreferrer">Matlab camproj</a></p>

<p>It seems similar to the "Trimetric" projection described here:</p>

<p><a href="https://en.wikipedia.org/wiki/Orthographic_projection" rel="nofollow noreferrer">Wikipedia on Orthographic Projection</a></p>

<p>see the picture here:</p>

<p><a href="https://en.wikipedia.org/wiki/Orthographic_projection#/media/File:Graphical_projection_comparison.png" rel="nofollow noreferrer">Wikipedia picture - Comparison of projections</a></p>

<p>but I don't know whether they are definitely the same. Does anyone know the exact details of the Matlab projection ?</p>

<p>Thank you !</p>

<projections><matlab>
What exactly is the orthographic projection used by Matlab
Simon
# What exactly is the orthographic projection used by Matlab

(Asked by: username_0 on 2019-09-22)

I would like to imitate the orthographic projection that Matlab uses by default:

[Matlab View Projections](https://uk.mathworks.com/help/matlab/creating_plots/understanding-view-projections.html)

and

[Matlab camproj](https://uk.mathworks.com/help/matlab/ref/camproj.html)

It seems similar to the "Trimetric" projection described here:

[Wikipedia on Orthographic Projection](https://en.wikipedia.org/wiki/Orthographic_projection)

see the picture here:

[Wikipedia picture - Comparison of projections](https://en.wikipedia.org/wiki/Orthographic_projection#/media/File:Graphical_projection_comparison.png)

but I don't know whether they are definitely the same. Does anyone know the exact details of the Matlab projection ?

Thank you !

**Tags:** projections, matlab


---

## 3 answers

### Answer by username_1 on 2021-04-02. Score: 1

All of these projections fall under the generic group of projections called "Axonometric" projections. The general goal of an axonometric projection is to manipulate the object using rotations and translations such that at least three adjacent faces of the projected object are shown. The result is projected from the center at infinity onto one of the coordinate planes usually the Z=0 plane. There are three common types of axonometric projections, trimetric, dimetric and isometric. With trimetric being the most general, dimetric is a specialization of trimetric with two of the three foreshortening factors being equal to each other, and isometric is a specialization of dimetric with the third foreshortening factor set equal to the other two (so all three are equal). Also note that the projection plane in this case is the Z plane. The matrix show below can be modified to use any of the X, Y or Z planes as the projection plane.

The general matrix form of all three (since dimetric and isometric are specializations of trimetric) is:

\begin{bmatrix}
&cos\phi &sin\phi sin\theta &0 &0 \\
&0 &cos\theta &0 &0 \\
&sin\phi &-cos\phi sin\theta &0 &0 \\
&0 &0 &0 &1
\end{bmatrix}

Where phi is the rotation around the y axis and theta is the rotation around the x axis. The foreshortening length of each axis can be computed just by taking the sum of the squares of each row. Then take the square root to get the length. For the X axis this would be:

\begin{equation}
f\_{x}^{2} = cos^{2}\phi + sin^{2}\phi sin^{2}\theta
\end{equation}

A little bit of algebra will yield the values needed to compute the lengths of the other 2.

To determine a trimetric projection all we need are the two viewing angles. For a diametric or isometric view we need to set the foreshortening factors equal to either two or three of the axis. By using the lengths of the rows and setting them equal to one another then solving we can compute any of the values needed for either projection.


---

### Answer by username_2 on 2019-09-29. Score: 0

All of the above. If you look on matlabs page a little further down, it becomes apparent that matlab initializes a canvas (the screen), then looks for each pixel what is directly behind that screen. This gets rid of perspective. When you set the camera angle to 45 degrees down and 45 degrees left/right, you will get an implicit isometric projection. So really the "projection" just depends on your camera angle.

Sidenote: if you would want to keep a 3d perspective, you would need to draw the ray from the camera origin to the position on the canvas. That gives the ray the direction it needs to create perspective.


---

### Answer by username_3 on 2019-11-08. Score: 0

It's tricky because there are 2 non-uniform scales called "DataAspectRatio" and "PlotBoxAspectRatio". I worked through a simple case in [the answer to this post](https://www.mathworks.com/matlabcentral/answers/248362-screen-2d-projection-of-3d-plot), but I'm afraid that doesn't cover all of the edge cases.


---

