![]() ![]() ![]() You replace the current matrix with the identity matrix using glLoadIdentity. ![]() When you call glMatrixMode, you are switching between these matrices. There is also a texture matrix we won't worry about. OpenGL internally maintains two matrices: modelview (model and view multiplied together), and projection. You would project a coordinate C onto the screen using the formula: C' = P * V * M * C Projection matrix (view to projection space).The scaling factor is needed for certain transformations like perspective projection that wouldn't be possible with non-homogenous coordinates.Ĥx4 matrices are needed to transform coordinates from one vector space to another. You can obtain coordinates in 3-space as (x/w, y/w, z/w). Projection space - everything on the screen fits in the interval in each dimension.Ĭoordinates are specified homogeneously, so each vector has components (x, y, z, w), where w is a scaling factor. ![]() View space - coordinates are specified with respect to the camera.World space - coordinates are specified with respect to some central point in the world.Model space - these are usually the coordinates you specify to OpenGL.In 3D graphics, you need to worry about several vector spaces: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |