You are on page 1of 4

3D projection

3D projection is any method of mapping three- orthographically projected image are of the same scale
dimensional points to a two-dimensional plane. As most regardless of whether they are far away or near to the vir-
current methods for displaying graphical data are based tual viewer. As a result, lengths near to the viewer are not
on planar (pixel information from several bitplanes) two- foreshortened as they would be in a perspective projec-
dimensional media, the use of this type of projection is tion.
widespread, especially in computer graphics, engineering
and drafting.
2 Weak perspective projection
1 Orthographic projection
A weak perspective projection uses the same principles
of an orthographic projection, but requires the scaling
Main article: Orthographic projection factor to be specied, thus ensuring that closer objects
appear bigger in the projection, and vice versa. It can
When the human eye looks at a scene, objects in the dis- be seen as a hybrid between an orthographic and a per-
tance appear smaller than objects close by. Orthographic spective projection, and described either as a perspective
projection ignores this eect to allow the creation of to- projection with individual point depths Zi replaced by
scale drawings for construction and engineering. an average constant depth Zave ,[1] or simply as an ortho-
graphic projection plus a scaling.[2]
Orthographic projections are a small set of transforms of-
ten used to show prole, detail or precise measurements The weak-perspective model thus approximates perspec-
of a three dimensional object. Common names for ortho- tive projection while using a simpler model, similar to the
graphic projections include plane, cross-section, birds- pure (unscaled) orthographic perspective. It is a reason-
eye, and elevation. able approximation when the depth of the object along
the line of sight is small compared to the distance from
If the normal of the viewing plane (the camera direction)
the camera, and the eld of view is small. With these con-
is parallel to one of the primary axes (which is the x, y, or
ditions, it can be assumed that all points on a 3D object
z axis), the mathematical transformation is as follows; To
are at the same distance Zave from the camera without
project the 3D point ax , ay , az onto the 2D point bx ,
signicant errors in the projection (compared to the full
by using an orthographic projection parallel to the y axis
perspective model).
(prole view), the following equations can be used:
Equation

bx = sx ax + cx
X
Px = Zave
by = sz az + cz Y
Py = Zave

where the vector s is an arbitrary scale factor, and c is an


assuming focal length f = 1 .
arbitrary oset. These constants are optional, and can be
used to properly align the viewport. Using matrix multi-
plication, the equations become:
3 Perspective projection

[ ] [ ] a [ ]
bx s 0 0 x c See also: Transformation matrix and Camera matrix
= x ay + x
by 0 0 sz cz
az
When the human eye views a scene, objects in the dis-
While orthographically projected images represent the tance appear smaller than objects close by - this is known
three dimensional nature of the object projected, they as perspective. While orthographic projection ignores
do not represent the object as it would be recorded pho- this eect to allow accurate measurements, perspective
tographically or perceived by a viewer observing it di- projection shows distant objects as smaller to provide ad-
rectly. In particular, parallel lengths at all points in an ditional realism.

1
2 3 PERSPECTIVE PROJECTION

The perspective projection requires a more involved def-


inition as compared to orthographic projections. A con-
ceptual aid to understanding the mechanics of this pro-
jection is to imagine the 2D projection as though the dx = cy (sz y + cz x) sy z
object(s) are being viewed through a camera viewnder. dy = sx (cy z + sy (sz y + cz x)) + cx (cz y sz x)
The cameras position, orientation, and eld of view con- dz = cx (cy z + sy (sz y + cz x)) sx (cz y sz x)
trol the behavior of the projection transformation. The
following variables are dened to describe this transfor- This transformed point can then be projected onto the 2D
mation: plane using the formula (here, x/y is used as the projection
plane; literature also may use x/z):[6]
ax,y,z - the 3D position of a point A that is to be
projected.
ez
cx,y,z - the 3D position of a point C representing the bx = dz dx ex
ez .
camera. by = dz dy ey

x,y,z - The orientation of the camera (represented


by TaitBryan angles). Or, in matrix form using homogeneous coordinates, the
system
ex,y,z - the viewers position relative to the display
surface [3] which goes through point C representing
the camera.
fx 1 0 eexz 0 dx
fy 0 e
eyz 0
Which results in: = 1 dy
fz 0 0 1 0 dz

fw 0 0 1/ez 0 1
bx,y - the 2D projection of a .

in conjunction with an argument using similar triangles,


When cx,y,z = 0, 0, 0, and x,y,z = 0, 0, 0, the 3D
leads to division by the homogeneous coordinate, giving
vector 1, 2, 0 is projected to the 2D vector 1, 2 .
Otherwise, to compute bx,y we rst dene a vector dx,y,z
as the position of point A with respect to a coordinate sys-
tem dened by the camera, with origin in C and rotated bx = fx /fw
by with respect to the initial coordinate system. This .
by = fy /fw
is achieved by subtracting c from a and then applying a
rotation by to the result. This transformation is often
called a camera transform, and can be expressed as fol- The distance of the viewer from the display surface, ez
lows, expressing the rotation in terms of rotations about , directly relates to the eld of view, where = 2
the x, y, and z axes (these calculations assume that the tan1 (1/ez ) is the viewed angle. (Note: This assumes
axes are ordered as a left-handed system of axes): [4] [5] that you map the points (1,1) and (1,1) to the corners
of your viewing surface)
Theabove
equations can also be
rewritten
as:
dx 1 0 0 cos(y ) 0 sin(y ) cos(z ) sin(z ) 0 ax cx
dy = 0 cos(x ) sin(x ) 0 1 0 sin(z ) cos(z ) 0 ay cy
dz 0 sin(x ) cos(x ) sin(y ) 0 cos(y ) 0 0 1 az cz
bx = (dx sx )/(dz rx )rz
This representation corresponds to rotating by three Euler by = (dy sy )/(dz ry )rz .
angles (more properly, TaitBryan angles), using the xyz
convention, which can be interpreted either as rotate
about the extrinsic axes (axes of the scene) in the order In which sx,y is the display size, rx,y is the recording
z, y, x (reading right-to-left)" or rotate about the intrin- surface size (CCD or lm), rz is the distance from the
sic axes (axes of the camera) in the order x, y, z (reading recording surface to the entrance pupil (camera center),
left-to-right)". Note that if the camera is not rotated ( and dz is the distance, from the 3D point being projected,
x,y,z = 0, 0, 0 ), then the matrices drop out (as iden- to the entrance pupil.
tities), and this reduces to simply a shift: d = a c. Subsequent clipping and scaling operations may be nec-
Alternatively, without using matrices (lets replace (a-c) essary to map the 2D plane onto any particular display
with x and so on, and abbreviate cos to c and sin to s): media.
3

4 Diagram Homography

Homogeneous coordinates
Perspective (graphical)

Texture mapping
Virtual globe

Transform and lighting

6 References
Bz Az
[1] Subhashis Banerjee (2002-02-18). The Weak-
Perspective Camera.

[2] Alter, T. D. (July 1992). 3D Pose from 3 Corresponding


Points under Weak-Perspective Projection (PDF) (Techni-
cal report). MIT AI Lab.

[3] Ingrid Carlbom, Joseph Paciorek (1978). Planar


Geometric Projections and Viewing Transformations
(PDF). ACM Computing Surveys. 10 (4): 465502.
Bx doi:10.1145/356744.356750..

[4] Riley, K F (2006). Mathematical Methods for Physics and


Ax Engineering. Cambridge University Press. pp. 931, 942.
doi:10.2277/0521679710. ISBN 0-521-67971-0.

To determine which screen x-coordinate corresponds to a [5] Goldstein, Herbert (1980). Classical Mechanics (2nd ed.).
point at Ax , Az multiply the point coordinates by: Reading, Mass.: Addison-Wesley Pub. Co. pp. 146148.
ISBN 0-201-02918-9.

[6] Sonka, M; Hlavac, V; Boyle, R (1995). Image Processing,


Bz Analysis & Machine Vision (2nd ed.). Chapman and Hall.
Bx = Ax
Az p. 14. ISBN 0-412-45570-6.
where

Bx is the screen x coordinate


7 Further reading
Ax is the model x coordinate Kenneth C. Finney (2004). 3D Game Programming
Bz is the focal lengththe axial distance from All in One. Thomson Course. p. 93. ISBN 978-1-
the camera center to the image plane 59200-136-1.
Az is the subject distance. Koehler; Dr. Ralph. 2D/3D Graphics and Splines
with Source Code. ISBN 0759611874.
Because the camera is in 3D, the same works for the
screen y-coordinate, substituting y for x in the above dia-
gram and equation. 8 External links
A case study in camera projection
5 See also
Creating 3D Environments from Digital Pho-
Viewing frustum tographs

3D computer graphics
Camera matrix
Computer graphics
Graphics card
4 9 TEXT AND IMAGE SOURCES, CONTRIBUTORS, AND LICENSES

9 Text and image sources, contributors, and licenses


9.1 Text
3D projection Source: https://en.wikipedia.org/wiki/3D_projection?oldid=740754375 Contributors: Mrwojo, Patrick, Michael Hardy,
Flamurai, Alo, Cyp, Angela, Raven in Orbit, Schneelocke, Charles Matthews, Sboehringer, Furrykef, Omegatron, Bloodshedder, Robbot,
Jaredwf, Altenmann, RossA, Cholling, Giftlite, DocWatson42, BenFrantzDale, Dratman, Tristanreid, Ctachme, Allefant, Aniboy2000,
RJHall, Sietse Snel, Marco Polo, Pearle, Mdd, Stephan Leeds, Oleg Alexandrov, Zanaq, Lincher, Waldir, Plowboylifestyle, Que, Rjwilmsi,
Kevmitch, Mathbot, Krishnavedala, Bgwhite, Froth, MathsIsFun, SmackBot, Canthusus, Chris the speller, Bluebot, TimBentley, Nbarth,
Tamfang, Berland, PsychoAlienDog, Ckatz, Van helsing, Harej bot, Michaelbarreto, Luckyherb, Davidhorman, Bobbygao, PhilKnight,
Deom, Seet82, Cpl Syx, Akulo, R'n'B, SharkD, RenniePet, GrahamHardy, Remi0o, Technopat, Paolo.dL, Dhateld, Stestagg, Martarius,
ClueBot, Gamer Eek, Speshall, Tyler, Skytiger2, Sandeman684, Baudway, Addbot, MrOllie, LaaknorBot, Yobot, Datadelay~enwiki, Ra-
biee, Citation bot, Akilaa, Vgergo, TinucherianBot II, Unigfjkl, BrainFRZ, Miym, FrescoBot, Citation bot 1, Bunyk, Drag0nius, Trappist
the monk, RjwilmsiBot, John of Reading, Pickypickywiki, Jovianconict, Heymid, ZroBot, AManWithNoPlan, Ego White Tray, ClueBot
NG, Twillisjr, Widr, Wiki13, Aisteco, Aekquy, TwoTwoHello, Ieay4a, Kees3125, Narky Blert, Janelbriosyk, Dhirgham Murran, Fmadd,
Bender the Bot, Edmond Michal and Anonymous: 106

9.2 Images
File:5-cell.gif Source: https://upload.wikimedia.org/wikipedia/commons/d/d8/5-cell.gif License: Public domain Contributors: Transferred
from en.wikipedia to Commons. Original artist: JasonHise at English Wikipedia
File:Axonometric_projection.svg Source: https://upload.wikimedia.org/wikipedia/commons/4/48/Axonometric_projection.svg Li-
cense: Public domain Contributors: This vector image was created with Inkscape. Original artist: Yuri Raysper
File:Commons-logo.svg Source: https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg License: PD Contributors: ? Origi-
nal artist: ?
File:Perspective_transform_diagram.svg Source: https://upload.wikimedia.org/wikipedia/commons/a/af/Perspective_transform_
diagram.svg License: CC0 Contributors: Own work Original artist: Krishnavedala

9.3 Content license


Creative Commons Attribution-Share Alike 3.0

You might also like