Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Graphics pipeline
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Projection ==== The [[3D projection]] step transforms the view volume into a cube with the corner point coordinates (β1, β1, 0) and (1, 1, 1); Occasionally other target volumes are also used. This step is called ''projection'', even though it transforms a volume into another volume, since the resulting Z coordinates are not stored in the image, but are only used in [[Z-buffering]] in the later rastering step. In a [[perspective (visual)|perspective illustration]], a [[central projection]] is used. To limit the number of displayed objects, two additional clipping planes are used; The visual volume is therefore a truncated pyramid ([[frustum]]). The parallel or [[orthogonal projection]] is used, for example, for technical representations because it has the advantage that all parallels in the object space are also parallel in the image space, and the surfaces and volumes are the same size regardless of the distance from the viewer. Maps use, for example, an orthogonal projection (so-called [[orthophoto]]), but oblique images of a landscape cannot be used in this way β although they can technically be rendered, they seem so distorted that we cannot make any use of them. The formula for calculating a perspective mapping matrix is: <math>\begin{pmatrix} w & 0 & 0 & 0\\ 0 & h & 0 & 0\\ 0 & 0 & {far}/({near-far}) & -1\\ 0 & 0 & ({near}*{far}) / ({near}-{far}) & 0 \end{pmatrix}</math> : With h = cot (fieldOfView / 2.0) (aperture angle of the camera); w = h / aspect Ratio (aspect ratio of the target image); near = Smallest distance to be visible; far = The longest distance to be visible. The reasons why the smallest and the greatest distance have to be given here are, on the one hand, that this distance is divided to reach the scaling of the scene (more distant objects are smaller in a perspective image than near objects), and on the other hand to scale the Z values to the range 0..1, for filling the [[Z-buffer]]. This buffer often has only a resolution of 16 bits, which is why the near and far values should be chosen carefully. A too-large difference between the near and the far value leads to so-called [[Z-fighting]] because of the low resolution of the Z-buffer. It can also be seen from the formula that the near value cannot be 0 because this point is the focus point of the projection. There is no picture at this point. For the sake of completeness, the formula for parallel projection (orthogonal projection): <math>\begin{pmatrix} 2.0/w & 0 & 0 & 0\\ 0 & 2.0/h & 0 & 0\\ 0 & 0 & 1.0/({near-far}) & -1\\ 0 & 0 & {near} / ({near}-{far}) & 0 \end{pmatrix}</math> : with w = width of the target cube (dimension in units of the world coordinate system); H = w / aspect Ratio (aspect ratio of the target image); near = Smallest distance to be visible; far = longest distance to be visible. For reasons of efficiency, the camera and projection matrix are usually combined into a transformation matrix so that the camera coordinate system is omitted. The resulting matrix is usually the same for a single image, while the world matrix looks different for each object. In practice, therefore, view and projection are pre-calculated so that only the world matrix has to be adapted during the display. However, more complex transformations such as vertex blending are possible. Freely programmable [[geometry shader]]s that modify the geometry can also be executed. In the actual rendering step, the world matrix * camera matrix * projection matrix is calculated and then finally applied to every single point. Thus, the points of all objects are transferred directly to the screen coordinate system (at least almost, the value range of the axes is still β1..1 for the visible range, see section "Window-Viewport-Transformation").
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)