Projection Transformations (projective transformation)

Monday to Friday, a day, 7 am Beijing time on time updates -

The projection transformation is applied to your vertices after the model-view transformation. This projection actually defines the viewing volume and establishes clipping planes (projection transformation occurs after the model viewport transformation, the matrix and defines the frustum clipping plane are). the clipping planes are plane equations in 3D space that OpenGL uses to determine whether geometry can be seen by the viewer (clipping plane is defined in 3D space, OpenGL using these clipping plane to determine what geometric objects can be seen). More specifically , the projection transformation specifies how a finished scene (after all the modeling is done) is projected to the final image on the screen (more precisely, the projection transformation determines how the 3D scene to become a 2D projection screen). You learn more about two types of projections-orthographic and perspective (you will learn more about the Two projection matrix - the orthogonal projection and a perspective projection). in an orthographic, or parallel, projection, all the polygons are drawn on s creen with exactly the relative dimensions specified (in an orthogonal projection, all of the polygons remains unchanged). Lines and polygons are mapped directly to the 2D screen using parallel lines, which means no matter how far away something is, it is still drawn the same size, just flattened against the screen (that is, no matter how far the object is from the observer, size of the object remain unchanged). this type of projection is typically used for rendering two-dimensional images such as the front, top, and side elevations in blueprints or two-dimensional graphics such as text or on-screen menus (such 2D mode is particularly suited to do the picture). a perspective projection shows scenes more as they appear in real life instead of as a blueprint (perspective projection is generated near the far smaller effect, like that seen in your life scenes). the hallmark of perspective projections is foreshortening, which makes distant objects appear smaller than nearby objects of the same size. lines in 3D space that might be parallel do not always appear parallel to the viewer (in the perspective projection, line originally 3D world are parallel, but will looks Not parallel). With a railroad track, for instance, the rails are parallel, but using perspective projection, they appear to converge at some distant point (here to give an example spade what what was originally parallel, but not in parallel perspective projection). The benefit of perspective projection is that you do not have to figure out where lines converge or how much smaller distant objects are (perspective projection of the benefits is that you do not need to care about those thing in the end how much). All you need to do is specify the scene using the model-view transformations and then apply the perspective projection matrix (you need to do is to try to object model viewport matrix transform it, and then to deal with the perspective matrix, linear algebra will help you deal with all the problems). linear algebra works all the magic for you. Figure 4.12 compares orthographic and perspective projections on two different scenes (Figure 4.12 shows the effects of perspective and orthogonal to two different scenarios of the projection). As you can see in the orthographic projection shown on the left, the cubes do not appear to change in size as they move farther from the viewer (as you can see on the left is an orthogonal projection, cube when more and more distant, the same size). However,

Projection Transformations (projective transformation)
Orthographic projections are used most often for 2D drawing purposes where you want an exact correspondence between pixels and drawing units. You might use them for a schematic layout, text, or perhaps a 2D graphing application. You also can use an orthographic projection for 3D renderings when the depth of the rendering has a very small depth in comparison to the distance from the viewpoint (generally speaking, the orthogonal projection suitable for 2D applications, and sometimes get to do some of the depth of the change is not very obvious rendering of 3D scenes ). Perspective projections are used for rendering scenes that contain wide-open spaces or objects that need to have foreshortening applied. for the most part, perspective projections are typical for 3D graphics. In fact, looking at a 3D object with an orthographic projection can be somewhat unsettling. (perspective projection is used to make 3D products, this product is obvious feature is the need to have near the far smaller effect, in fact, if you use the orthogonal projection to display the 3D scene, you will feel Egg pain)

Perspective Matrices (the perspective matrix)

Once your vertices are in view space, we need to get them into clip space, which we do by applying our projection matrix, which may represent a perspective or orthographic projection (or some other projection) ( When you get when your vertex data in view after the lower opening space, you need to play them to the trimming coordinates go, where projection transformation). a commonly used perspective matrix is a frustum matrix. a frustum matrix is a projection matrix that produces a perspective projection such that clip space takes the shape of a rectangular frustum , which is a truncated rectangular pyramid. Its parameters are the distance to the near and far planes and the world-space coordinate of the left, right, top, and bottom clipping planes. A frustrum matrix takes the following form :( a common view frustum perspective matrix is a matrix, the matrix is a perspective view frustum matrix, you need to specify about the far clipping plane down near clipping plane to define this matrix, it is presented in the shape of an inverted pyramid the following shows produced Frustum function)
Projection Transformations (projective transformation)
static inline MAT4 Frustum (left a float,
a float right,
bottom a float,
a float Top,
a float n-,
a float F) {...}
Another Method for Constructing A Common Matrix Perspective Directly to the Specify IS A AS AN Field of View angle (in degrees, Perhaps), AN Aspect ratio (derived by GeneRally dividing the window's width by its height ), and the view-space positions of the near and far planes. This is somewhat simpler to specify, and produces only symmetric frustra. However, this is almost always what you'll want. The vmath function to do this is vmath :: perspective :( another way is to specify the projection matrix directly specifying the viewport visible angle, aspect ratio, the near clipping plane far clipping plane use in our teaching system is the second way while also math .vmath derived origin of these matrices interfaces below)

static inline mat4 perspective(float fovy / in degrees /,
float aspect,
float n,
float f) { ... }
Orthographic Matrices(正交矩阵)

If you wish to use an orthographic projection for your scene, then you can construct a (somewhat simpler) orthographic projection matrix ( if you want to use orthogonal transform your scene, then you can build an orthogonal projection matrix). An orthographic projection matrix is simply a scaling matrix that linearly maps view-space coordinates into clip-space coordinates ( orthogonal projection matrix is a linear stuff in the viewport mapping space to clip space go). the parameters to construct the orthographic projection matrix are the left, right, top , and bottom coordinates in view space of the bounds of the scene, and the position of the near and far planes the form of the matrix is ( constructed such parameter matrices are: up and down, form near clipping plane, the far clipping plane, the matrix shown below) in FIG.
Projection Transformations (projective transformation)
Again, there's a vmath function to construct this matrix for you, vmath :: ortho: ( orthogonal matrix to create an interface library for vMATH follows :)

Ortho MAT4 inline static (float left,
float right,
float bottom,
float Top,
float near,
float FAR) {...}
translation of this day to get here, see you tomorrow, bye ~

Get the latest plot first time, please pay attention to the Eastern Han Dynasty academy and the heart of the public graphic No.

Han College, waiting for you to play Oh

Guess you like

Origin blog.51cto.com/battlefire/2427933