1
$\begingroup$

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:

enter image description here

However, I would like to see it with perspective, so it should look something like this:

enter image description here

What is the matrix multiplication that transfers the original points to the rotated+perspective points?

$\endgroup$
  • $\begingroup$ 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). $\endgroup$ – Andrew Wilson Mar 16 at 11:32
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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