Heuristic42
Blog
Opengl
Meta
Rendering
1
comment
Nov 19 at 15:47
Matrices
Hello, I hope this message finds you doing well. I believe…
–
anonymous
created
Oct 20 at 20:30
Iterators: pointers vs cursors
You're already doing both of these by hand. This post emphaisze…
–
pknowles
comment
Oct 10 at 10:27
Matrices
[deleted]
–
anonymous
comment
Oct 4 at 19:12
Matrices
[deleted]
–
anonymous
comment
Sep 30 at 18:51
Matrices
[deleted]
–
anonymous
comment
Sep 23 at 16:15
Matrices
[deleted]
–
anonymous
comment
Sep 21 at 6:52
Contributing
I kind of predicted what was bound to happen when my favourite …
–
anonymous
comment
Sep 7 at 1:21
Route contention when running docker and a VPN
Thank you for this. Between this and the overwriting of iptabl…
–
anonymous
comment
Sep 6 at 17:57
Making a real EMF Reader
Sorry for the random quoted text comments. I am one of those p…
–
anonymous
comment
Sep 6 at 17:48
Making a real EMF Reader
["ove! Play a tone with a buzzer and has 5 LEDs to show the “EM…
–
anonymous
comment
Sep 6 at 17:47
Making a real EMF Reader
["easure direction Measure the magnetic fie"](#q107-644-685)
–
anonymous
comment
Aug 20 at 17:01
Matrices
[deleted]
–
anonymous
comment
Aug 11 at 22:32
Matrices
[deleted]
–
anonymous
edited
Jun 8 at 22:29
Rethinking writing files with memory mapping and C++
This post introduces the motivation behind the [decodless C++ o…
–
admin
created
Jun 8 at 22:16
Rethinking writing files with memory mapping and C++
This post introduces the motivation behind the [decodless C++ o…
–
pknowles
comment
Jun 5 at 13:36
Contributing
[deleted]
–
anonymous
comment
Apr 19 at 11:24
Matrices
[deleted]
–
anonymous
comment
Apr 13 at 0:25
Matrices
[deleted]
–
anonymous
comment
Apr 5 at 9:43
Matrices
[deleted]
–
anonymous
comment
Mar 27 at 17:19
Matrices
[deleted]
–
anonymous
comment
Mar 25 at 4:59
Matrices
[deleted]
–
anonymous
comment
Mar 5 at 15:39
Matrices
[deleted]
–
anonymous
comment
Feb 7 at 5:45
Microsoft Natural Ergonomic 4000 Replacement
Thank you so much for sharing your thoughts here, it tells me e…
–
anonymous
comment
Jan 28 at 23:31
Microsoft Natural Ergonomic 4000 Replacement
Oh man, I feel this post. Not sure if you've seen the "new" new…
–
anonymous
…
View All
Log in
Cameras
leave this field blank to prove your humanity
Slug
*
A URL path component
Parent page
<root>
rendering/:Article2:3D Rendering (Computer Graphics)
--- rendering/cameras/:Article11:Cameras
--- rendering/matrices/:Article12:Matrices
------ rendering/matrices/projection/:Article14:Projection Matrix
--- rendering/vectors/:Article13:Vectors
--- rendering/geometry/:Article62:3D Geometry
------ rendering/geometry/triangle_meshes/:None
--- rendering/shading/:Article64:Shading
------ rendering/shading/transparency/:Article70:Transparency and Alpha Blending
--- rendering/lights/:Article65:Lights
--- rendering/rasterization/:None
------ rendering/rasterization/deepimage/:Article72:Deep Image
--- rendering/shadows/:Article67:Shadows
--- rendering/spaces/:Article68:Vector Spaces
------ rendering/spaces/tangent_space/:Article69:Tangent Space
------ rendering/spaces/clip_space/:Article89:Clip Space
--- rendering/rotations/:None
--- rendering/images/:Article74:<unset>:Images
------ rendering/images/mipmapping/:Article75:<unset>:Mipmapping
--- rendering/materials/:None
opengl/:Article3:OpenGL Tutorials
--- opengl/oit/:Article7:Order Independent Transparency (OIT)
--- opengl/framebuffer/:Article71:The Framebuffer
meta/:Article4:Pages About This Site
--- meta/contribute/:Article5:Contributing
--- meta/bugs/:Article9:Bugs
--- meta/about/:Article10:Why does this website exist?
The parent page this belongs to.
Article title
*
Article revisions must have a non-empty title
Article body
*
*This page is incomplete.* #Projection A camera’s main job is to project the 3D scene onto a 2D image by defining a mapping between 2D *image space* and 3D *camera* or *eye* space (see [spaces](/18/rendering/spaces/)). The camera model refers to how a virtual camera is implemented to imitate a real camera. This may be as simple as defining a [*rectilinear* projection](https://en.wikipedia.org/wiki/Rectilinear_lens), or include more complex optical distortion effects that appear with real camera lenses or lens systems. A perspective projection is the most common. Objects further away appear smaller, it is rectilinear (preserving straight lines), and can be defined by a [projection matrix](/11/rendering/matrices/projection/), unlike fisheye projections for example. A typical perspective projection matrix models a perfect pinhole camera, visualized in the image below, where light from the scene passes through a point (which is considered the camera’s origin, or position) and falls on the image plane. The image is formed by a bounding region on the image plane, where the film or digital sensor would be (sensor is a good term as it includes the concepts of pixels and image resolution). In a real pinhole camera the field of view would be defined by how far away the image plane is from the pinhole and how big the sensor is. However, these things are not necessary to model and the perspective projection can simply include a field of view attribute directly. Aspect ratio, near and far planes are also important to define a viewing volume, discussed further at [projections](/11/rendering/matrices/projection/). ![pinhole camera][1] #Position The next thing to discuss is positioning the camera in the virtual world. An *x, y, z* position and either *yaw, pitch, roll* euler rotation or *x, y, z, w* quaternion (discussed later. also see [rotations](/23/rendering/rotations/)) is standard. Both camera position and rotation can be combined into a single transformation matrix which defines a mapping between world space and eye space. It is logical to think of the perspective projection’s viewing volume placed at the camera’s position and rotation in world space along with all the other objects in the scene, as in the image below. However this may lead to some confusion when dealing with the camera’s transform. Rather than placing the camera at a position in world space, like other objects, it is the inverse transform. It may help to think of the camera transform as moving the world around it to position and orientate it correctly (i.e. rotate the world left to look right). To explain this further, rendering begins with geometry (primarily vertex positions) in object space, which is ultimately transformed into image space. The visualization here is in world space, so the chain is image?eye?*world*?object. An important distinction is that the transform to place an object in the world space is in the opposite direction as eye to world. The camera transform is the inverse of a transform to place a model at the same spot in world space. ![Camera and objects in world space][2] Many 3D graphics tutorials start by introducing a “look-at” function, which places the camera at a given position in world space and looking towards a target position. An “up” direction vector is also specified to support arbitrary rotation. This may be fine for a fixed test view, but in most cases the camera’s orientation needs to be set directly for smooth movement/interpolation. Euler rotations are typically used for cameras where there is a fixed up-direction due to the human-relatable Gimbal lock effect. Any orientation can still be described by euler angles, although further rotation by summing rotation components is not the same as adding arbitrary rotations. For example, a yaw rotation (horizontal rotation) becomes a roll (the image rotates about its centre) if the pitch (vertical rotation) is far from horizontal, pointing up or down. Quaternions allow efficient arbitrary rotation addition and smooth interpolation. Some usage examples include the orientation of a plane in a flight simulator or a trackball in a modelling package. [1]: /u/img/12cad7955c57.svg [2]: /u/img/195a918e3358.svg
Toggle Preview
Edit message
*
A description of the changes made
Discard Draft
Save Draft
leave this field blank to prove your humanity
Flag
the thing you clicked
for moderator attention.
Reason choice:
Spam, promoting, advertising without disclosure
Rude, inappropriate, generally offensive
Too arrogant or demeaning to others
Other
Reason:
The reason for raising the flag
Error