120 likes | 292 Views
Introduction to OpenGL Pipeline From Programmer View. Tong-Yee Lee. OpenGL Transformation Pipeline. normalized device. eye. object. clip. window. v e r t e x. Modelview Matrix. Projection Matrix. Perspective Division. Viewport Transform. Modelview. Projection. Modelview.
E N D
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee
OpenGL Transformation Pipeline normalized device eye object clip window v e r t e x Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection Modelview glTranslate{fd}( x, y, z ) glRotate{fd}( angle, x, y, z ) glScale{fd}( x, y, z ) l l l
tripod OpenGL Transformation Pipeline normalized device eye object clip window v e r t e x Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection Modelview l l l gluLookAt( eyex, eyey, eyez, aimx, aimy, aimz, upx, upy, upz )
Changes of Coordinate System World coordinate system Camera (eye) coordinate system
normalized device eye object clip window v e r t e x viewing volume Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection Modelview model l l l OpenGL Transformation Pipeline Perspective projection • Orthographic parallel projection
Perspective projection • gluPerspective( fovy, aspect, zNear, zFar ) • glFrustum(left,right,bottom,top,zNear,zFar) • Orthographic parallel projection • glOrtho(left,right,bottom,top,zNear,zFar) • gluOrtho2D( left, right, bottom, top )
normalized device eye object clip window v e r t e x Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection Modelview l l l h w glViewport( 0, 0, (GLsizei) w, (GLsizei) h );
glMaterialfv( face, property, value ); glNormal3f( x, y, z ) glLightfv( light, property, value );