SlideServe
Menu
Préférences
© SlideServe · v2026

Lab 5

afya avatar
21 diapositives · 385 Views · Jul 30, 2014

Graphics. Lab 5. Transformation Viewport Clipping . Transformation Modeling -> translate (); rotate ();scale() Viewing -> lookat () ; Projection : Perspective Orthographic Viewport Clipping . Projections . There are two basic types of projections: Perspective:

Lab 5 - slide 1
01 / 21Lab 5
1 / 17

Télécharger la présentation

Lab 5
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Graphics Lab 5

  2. Transformation • Viewport • Clipping

  3. Transformation • Modeling ->translate (); rotate ();scale() • Viewing ->lookat() ; • Projection : • Perspective • Orthographic • Viewport • Clipping

  4. Projections • There are two basic types of projections: • Perspective: • Orthographic = Parallel

  5. Perspective: gluPerspective(fov_y, aspect_ratio, near, far) • fov_y is vertical field-of-view in degrees • aspect ratio = width / height • near, far are distances from eye to two clipping planes • must be positive

  6. Zoom • Field of view: Smaller angle means more zoom

  7. OpenGL Projection • For orthographic projection • For perspective projection • Window parameters are with respect to view position and orientation glMatrixMode(GL_PROJECTION); glOrtho(xwmin,xwmax,ywmin,ywmax,dnear,dfar); glMatrixMode(GL_PROJECTION); gluPerspective(theta,aspect,dnear,dfar); glMatrixMode(GL_MODELVIEW); gluLookAt(x0,y0,z0,xref,yref,zref,Vx,Vy,Vz); … other modelview transformations … *Note: dnear and dfar are the distances from camera position to near and far planes respectively. They should be positive.

  8. orthographic projection glOrtho(left, right, bottom, top, near, far) • left, right, bottom, top are coordinates in eye space • left, right are the x-coordinate limits • bottom, top are the y-coordinate limits • near, far are signed distances from the eye to the near and far

  9. Notes : when Zeye equal with zfar ,the object will be Disappearance

  10. Viewport : • EX: glViewport (0, 0, (GLsizei)width, (GLsizei)height);

  11. void keyboard (unsigned char key, int x, int y) • In the main : • glutKeyboardFunc(keyboard);