Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am representing 3D points (vectors) in the following way:

(* conversion from 3D point, represented by normal list of \
coordinates, to matrxi column, suitable for transforms *)
ToColumn[point_] := Transpose[{Append[point, 1]}];

enter image description here

(* conversion from matrix column, representing 3D point, to a list, \
representing the same point *)
ToPoint[column_] := Take[Transpose[column/column[[4, 1]]][[1]], 3];

enter image description here

I.e. forth element serves as the scale factor.

(Is this conventional representation and what is the name of it?)

I am representing perspective transform with the following matrix:

PerspectiveXYZ[{x_, y_, z_}] := {
   {1, 0, 0, 0},
   {0, 1, 0, 0},
   {0, 0, 1, 0},
   {x, y, z, 0}

so that

enter image description here

My question is: what is the sense of transform elements x, y and z?

I drew a cube of 8 points and transformed it with various values of these variables:

enter image description here

And found, that x and y controls projection plane orientation, while z controls both the scale and distance from origin point, while z=1 means projecting into some small region (1?), and that the smaller this value, the bigger is the scale, becoming infinite when z=0.

Is there any clear geometric interpretation of these values, especially z? May be they should be substituted with 1/z or something for better interpretation?

May be my vector model should be changed?

share|cite|improve this question
It's a fact that if you use "homogeneous coordinates" then a perspective (or projective) transformation from a (projective) plane to a (projective) plane can be represented by a $3 \times 3$ "homogeneous" matrix. This is one reason homogeneous coordinates are useful, though they seem unintuitive at first. – littleO Jun 14 '13 at 10:28
I am using 4x4 matrices. – Suzan Cioc Jun 14 '13 at 10:36
But warpPerspective accepts a $3 \times 3$ matrix, so why are you using $4 \times 4$ matrices? Also, I don't understand exactly what your question is. – littleO Jun 14 '13 at 11:51
See my update. 3x3 matrix gives the same result (I think) as 4x4 matrix with 3rd row/column excluded / turned to zero. My question is more general. – Suzan Cioc Jun 14 '13 at 11:55
Thanks. I'm confused now about why the $4 \times 4$ matrix isn't invertible, I had thought that it should be. Btw, a decent reference for this stuff is the book Multiple View Geometry in Computer Vision by Hartley and Zisserman. – littleO Jun 14 '13 at 19:43

The matrix

enter image description here

defines a perspective projection onto the plane with equation

$Ax + By + Cz + D=0$

Perspective is build with the center in the origin.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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