![]() ![]() The projection matrix governs the perspective effect applied to primitives, and is controlled in a similar way to the modelview matrix: GlTranslatef( 0, 0, -3 ) /* Translate the modelview 3 units along the Z axis */ GlLoadIdentity() /* Initialise the modelview to identity */ GlMatrixMode( GL_MODELVIEW ) /* Subsequent matrix commands will affect the modelview matrix */ We move it backwards 3 units along the Z axis, which leaves it pointing towards the origin: We now set the modelview matrix, which controls the position of the camera relative to the primitives we render. We first clear the color buffer, in order to start with a blank canvas: Many modern 3D accelerators provide functionality far above this baseline, but these new features are generally enhancements of this basic pipeline rather than radical reinventions of it. Rasterised points, lines and polygons as basic primitives.OpenGL has historically been influential on the development of 3D accelerators, promoting a base level of functionality that is now common in consumer-level hardware: OpenGL's low-level design requires programmers to have a good knowledge of the graphics pipeline, but also gives a certain amount of freedom to implement novel rendering algorithms. This contrasts with descriptive (aka scene graph or retained mode) APIs, where a programmer only needs to describe a scene and can let the library manage the details of rendering it. OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact steps required to render a scene. Prior to the introduction of OpenGL 2.0, each stage of the pipeline performed a fixed function and was configurable only within tight limits but in OpenGL 2.0 several stages are fully programmable using GLSL. Most OpenGL commands either issue primitives to the graphics pipeline, or configure how the pipeline processes these primitives. This is done by a graphics pipeline known as the OpenGL state machine. ![]() OpenGL's basic operation is to accept primitives such as points, lines and polygons, and convert them into pixels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |