SlideServe
Menu
Préférences
© SlideServe · v2026

Transformations in Computer Graphics: Modeling Objects into 3D Space for Visual Rendering

mmcdermott avatar
18 diapositives · 227 Views · Jan 05, 2020

Explore methods to transform objects in world and eye space, projections into 2D, rotations, perspectives, parallel views, and viewing pipelines. Understand matrix representations for rotations, axis-angle transforms, and projection techniques. Learn about OpenGL matrix stacks for efficient viewing setup.

Transformations in Computer Graphics: Modeling Objects into 3D Space for Visual Rendering - slide 1
01 / 18Transformations in Computer Graphics: Modeling Objects into 3D Space for Visual Rendering
1 / 17

Télécharger la présentation

Transformations in Computer Graphics: Modeling Objects into 3D Space for Visual Rendering
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. Computer Graphics (Spring 2003) COMS 4160, Lecture 9: Transformations 2 Ravi Ramamoorthi http://www.cs.columbia.edu/~cs4160

  2. Motivation Modeling • Objects in convenient coordinate system • Transform into world space, eye space • Viewing: project world space into 2D rectangle • Virtual cameras • Types of projections (perspective, orthographic) • Window system

  3. Rotations • Very brief overview (not in detail) • For little more detail, some useful websites: • www.cs.berkeley.edu/~ug/slide/pipeline/assignments/as5/rotation.html • www.cs.cmu.edu/afs/cs/academic/class/16741-s02/www/lecture6.pdf

  4. Rotations • 2D (simple) • Matrix representation, commutative • 3D (complicated) • Non-commutative • Counterclockwise • Matrix reps for axis transforms

  5. Euler Angles • Rotate about Z, then new X, then new Z • [Goldstein pp 107] • Product of axis transforms • Efficient, 3 parameters • Bad for numerics, splining

  6. Axis-Angle • Single axis, angle about it • 3 params (axis is normalized) • Somewhat intuitive • Many of same numerical problems as Euler-Angles • Formula (axis-angle to rotation matrix) Dual Matrix of v

  7. Viewing 3D • Pipeline (pp 230 FvDFH) • Projection 3D -> 2D • Clip: near and far planes (viewing volume)

  8. The Whole Viewing Pipeline Eye coordinates Model coordinates Perspective transformation Model transformation Screen coordinates Viewport transformation World coordinates Camera transformation Window coordinates Raster transformation Device coordinates Slide courtesy Greg Humphreys

  9. Projections • To lower dimensional space • Preserve straight lines • Trivial example: Drop one coordinate • We are concerned with 3D -> 2D • Taxonomy [Fig 6.13, pp 237] • Perspective [realistic images, no proportions preserved] • Parallel [preserves proportions] • Orthographic (common in graphics)

  10. Perspective • Center of projection, rays, projection plane • Distance from center of projection to projection plane is finite. If infinite, projection rays parallel • Foreshortening: Key feature • Size inverse proportional to distance • Cameras, visual system are similar

  11. Perspective or Parallel? If the distance between the center of projection and the projection plane is finite, the projection is called a perspective projection. Otherwise, it’s a parallel projection. A A A’ A’ B B B’ B’ C (at infinity) C Parallel Perspective

  12. Perspective • Distortions • Lines remain lines, everything else is distorted… • Vanishing points for parallel lines • Shape distortions • Parallel Projections (parallel lines are parallel) • Not realistic but preserve size (useful in mechanical drawings)

  13. Parallel (Orthographic) • Projection vector (direction of rays) • Perpendicular to projection plane : Orthographic • Otherwise, oblique. • Far off objects in perspective are approx. orthographic • Uniform foreshortening • Parallelism preserved, angles are not • More info in book • We now concentrate on perspective…

  14. Perspective mathematically 1 Intuition: divide by z • Eye as a point (or pinhole camera) • Easy in eye space (homogeneous coordinates) Simple form: equation 6.4 page 255 Full mathematics next week

  15. Overhead View of Our Screen Looks like we’ve got some nice similar triangles here! Next few slides courtesy Greg Humphreys

  16. The Perspective Matrix • This “division by z” can be accomplished by a 4x4 matrix • We’re in homogeneous coordinates, so if we multiply some point by P, we get . • Recall that to get the actual 3D point, you divide by w, giving , which was the point on our screen. Now just drop the third coordinate!

  17. Viewing in OpenGL • OpenGL has multiple matrix stacks - transformation functions right-multiply the top of the stack • Two most important stacks: GL_MODELVIEW and GL_PROJECTION • Points get multiplied by the modelview matrix first, and then the projection matrix • This is only really necessary for convenience -- you could ignore all of this and put your entire viewing matrix into one or the other. However, if one is changing and the other one isn’t, you’ll save time

  18. OpenGL Example void SetUpViewing(){ // The viewport isn’t a matrix, it’s just state... glViewport( 0, 0, window_width, window_height ); // Set up camera transformation first glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 60, 1, 1, 1000 ); // fov, aspect, near, far gluLookAt( 3, 3, 2, // eye point 0, 0, 0, // look at point 0, 0, 1 ); // up vector // Set up the model transformation glMatrixMode( GL_MODELVIEW ); glRotatef( theta, 0, 0, 1 ); // rotate the model glScalef( zoom, zoom, zoom ); // scale the model }