# Perspective projection computation

I'm learning OpenGL from arcsynthesis and I don't understand something about perspective projection (http://www.arcsynthesis.org/gltut/Positioning/Tut04%20Perspective%20Projection.html).

When the author gives the example "2D to 1D Perspective Projection Diagram", is R a 2D point or a scalar? When I saw the figure I thought it was a scalar because of the title and I thought that P is projected in a line (the Projection Plan). But later, when I saw the perspective computation, I realized that R has the same number of coordinates of P, because, from that equation, R is a product of the vector P with a scalar, so basically, I don't understand how many coordinates has R.

I don't know where that equation (the perspective computation) comes from, if someone could just give me some information about it I would appreciate it.

## 1 Answer

The mark over the R suggests it is a vector. So does your reasoning. As for where the equation comes from, that is the whole point of that section of the book. The purpose of the 2D to 1D diagrams is to simplify the explanation of converting 3D to a 2D screen. If the material didn't sink in, read it again. Research other sources for different perspectives on the subject. Or perhaps, ask one of the contributors to the book.