# Simple Two Point Perspective of a Cube

I know this question may be a little basic, but still I haven't found an answer for it anywhere.

Let's say I have a normalized cube; vertices at (+-0.5, +-0.5, +-0.5) If I render it on screen (omitting the Z axis), I'll see a square.

If I rotate it along the Z axis with 45 degrees, I'll see two rectangles: However, I would like to see it with perspective, so it should look something like this: What is the matrix multiplication that transfers the original points to the rotated+perspective points?

• Without matrix form just rotate the points 45 degrees around the y axis. Then divide x and y by z and get rid of the z if you want perspective. How much you divide by z controls the fov (but is not formally the fov). – Andrew Wilson Mar 16 at 11:32

## 1 Answer

Your first image employs an orthographics projection, while the second uses a perspective projection. You can look up the perspective matrix derivation in: http://www.songho.ca/opengl/gl_projectionmatrix.html Note that there's a division at the end to account for perspective projection being a non-linear transformation.