120 likes | 305 Views
Tutorial 11. UVN viewing-coordinate reference frame n = N/|N| u = (V x n)/ |V| v = n x u. float viewAngle = 30.0; float aspectRatio = 1.5; float near = 40.0; float far = 180.0; glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(viewAngle, aspectRatio, near, far);.
E N D
Tutorial 11 UVN viewing-coordinate reference frame • n = N/|N| • u = (V x n)/ |V| • v = n x u
float viewAngle = 30.0; float aspectRatio = 1.5; float near = 40.0; float far = 180.0; glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(viewAngle, aspectRatio, near, far);
glMatrixMode(GL_PROJECTION); • glLoadIdentity(); • glFrustum(–20, 20, –10, 10, 50, 200);
glMatrixMode(GL_PROJECTION); • glLoadIdentity(); • glFrustum(–20, 20, –10, 10, 50, 200); • glMatrixMode(GL_MODELVIEW); • glLoadIdentity(); • gluLookAt(-10, 5, 30, 100, 30, -30, 0, 1 ,0);
eyeX, eyeY, eyeZ Specifies the position of the eye point. centerX, centerY, centerZ Specifies the position of the reference point. upX, upY, upZ Specifies the direction of the up vector.