Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 4.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

GR2 Advanced Computer Graphics AGR
SI23 Introduction to Computer Graphics
02/17/05CISC640/440 OpenGL Tutorial1 OpenGL Tutorial CISC 640/440 Computer Graphics TA: Qi Li/Mani Thomas
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
The View Frustum and the Camera Lecture 19 Fri, Oct 10, 2003.
Based on slides created by Edward Angel
Viewing and Transformation
Viewing and Projections
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 352: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Computer Graphics (Fall 2008) COMS 4160, Lecture 4: Transformations 2
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
CS 4731: Computer Graphics Lecture 9: Introduction to 3D Modeling Emmanuel Agu.
CS 470 Introduction to Computer Graphics Basic 3D in OpenGL.
Chapter 3 Vectors Coordinate Systems Used to describe the position of a point in space Coordinate system consists of A fixed reference point called.
Advanced Computer Graphics Three Dimensional Viewing
Geometric transformations The Pipeline
Shadows via Projection Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, November 5, 2003.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 5.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 2.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
Stages of Vertex Transformation To specify viewing, modeling, and projection transformations, you construct a 4 × 4 matrix M, which is then multiplied.
Computer Graphics I, Fall 2010 Computer Viewing.
Kinematics Jehee Lee Seoul National University. Kinematics How to animate skeletons (articulated figures) Kinematics is the study of motion without regard.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 6.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Appendix A.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
CGGM Lab. Tan-Chi Ho 2001 Viewing and Transformation.
Projections. Viewports Windows can have separate viewports void glViewport(GLint x, GLint y, GLsizei width, GLsizei height ) x, y - Specify the lower.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Chap 3 Viewing and Transformation
Honours Graphics 2008 Session 3. Today’s focus Perspective and orthogonal projection Quaternions Graphics camera.
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 21.
Tuesday, January 18 th Parallel and Perpendicular Lines.
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
Coordinate Systems Lecture 20 Wed, Oct 15, Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
OpenGL LAB III.
CS 490: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14.
Viewing.
Transformations Introduction to Computer Graphics and Animation
Computer Viewing.
Isaac Gang University of Mary Hardin-Baylor
Graphics Fundamentals
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Class 11 timers Iron Maiden example Double Buffering BallAndTorus
Three-Dimensional viewing
Class 12 Complex object with moving parts
Chapter V Vertex Processing
Type of View Perspective View COP(Center of Plane) Diminution of size
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Rotation: all points in the original figure rotate, or turn, an identical number of degrees around a fixed point.
University of New Mexico
Computer Graphics 3Practical Lesson
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 19.
Class 12 idle function timers Iron Maiden example Double Buffering
Presentation transcript:

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 4

Figure 4.1: Screenshot of box.cpp.

Figure 4.2: Translation: glTranslatef(p, q, r).

Figure 4.3: Translating into the viewing frustum.

Figure 4.4: Screenshot of Experiment 4.3.

Figure 4.5: Scaling: glScalef(u, v, w).

Figure 4.6: Screenshot of initial configuration of Experiment 4.4.

Figure 4.7: Reflection in the yz-plane.

Figure 4.8: Screenshots of Experiment 4.5: (a) before scaling (b) after.

Figure 4.9: Screenshot for Experiment 4.6.

Figure 4.10: Turning along a cylinder.

Figure 4.11: Rotation: glRotatef(A, p, q, r). The point P is rotated according to the 4-step process in the text. The rotation of a box is also shown.

Figure 4.12: glRotatef(A, 0.0, 0.0, 1.0).

Figure 4.13: Screenshots from Experiment 4.9.

Figure 4.14: Rotating a square about its own center.

Figure 4.15: Screenshots: (a) Experiments 4.10 and (b) 4.11.

Figure 4.16: Local system (bold) coincides with the global initially. The global system is fixed.

Figure 4.17: Transitions of the box, the box's local coordinates system (bold) and the sphere. The world coordinate system, which never changes, coincides with the box's initial local.

Figure 4.18: Screenshot of relativePlacement.cpp after all transformations from the scaling down have been executed.

Figure 4.19: Planning a head on a torso: (a) The plan (b) Drawn without isolating the scaling (c) After isolating the scaling.

Figure 4.20: Transitions of the modelview matrix stack.

Figure 4.21: Screenshot of rotatingHelix1.cpp.

Figure 4.22: Animation control in rotatingHelix3.cpp.

Figure 4.23: Successive cycles in double buffering.

Figure 4.24: Screenshot of ballAndTorus.cpp.

Figure 4.25: The ball's axis of latitudinal rotation from its start position is L.

Figure 4.26: Screenshot from Experiment 4.21.

Figure 4.27: Screenshot of throwBall.cpp.

Figure 4.28: Ball bouncing off wall.

Figure 4.29: Screenshot of (a) clown1.cpp (b) clown2.cpp (c) clown3.cpp.

Figure 4.30: (a) Cone drawn by glutWireCone(base, height, slices, stacks) (b) Torus drawn by glutWireTorus(inRadius, outRadius, sides, rings). Note that the axes are depicted differently in each diagram.

Figure 4.31: Screenshot of floweringPlant.cpp in mid-bloom.

Figure 4.32: (a) Ball rolling down one plane (b) Ball rolling down two planes (c) Ball bouncing on a box (d) Ball traveling along a helix (e) Four segments opening from a square into a straight line (f) Solar system with a sun, one planet and two moons (g) Pool table with one ball.

Figure 4.33: (a) The (conceptual) OpenGL camera's default pose (b) A (conceptual) point camera at the origin with film on the viewing plane of the frustum.

Figure 4.34: Camera pose determined by gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz).

Figure 4.35: (a) gluLookAt(): the broken frustum is the original viewing frustum, the unbroken one is where it's translated by the gluLookAt() call, the box doesn't move. (b) glTranslatef(): the viewing frustum doesn't move, rather the box is translated by the glTranslatef() call.

Figure 4.36: Sectional diagrams of the (simulated) conguration of the eye and frustum for various gluLookAt() calls in boxWithLookAt.cpp.

Figure 4.37: Screenshots from Experiment 4.28.

Figure 4.38: Taking the dot product: u·v = |u||v|cos θ.

Figure 4.39: (a) Splitting v into components v 1 and v 2, parallel and perpendicular to u, respectively (b) v 2 as the “shadow” of v on a plane p perpendicular to u.

Figure 4.40: The camera is seen face-forward so that its back-plane p lies on the page. The line of sight los comes perpendicularly up from the page toward the reader. The components of the vector up, parallel and perpendicular to los, respectively, are up 1 and up 2 (the latter lying on the page).

Figure 4.41: Solution to Exercise 4.44(a).

Figure 4.42: Checking the solution to Exercise 4.44(a).

Figure 4.43: Camera flying over balls.

Figure 4.44: Camera rotated on an imaginary sphere enclosing a teapot.

Figure 4.45: Relative movement of the camera and scene.

Figure 4.46: Restoring the camera to its default pose: broken arrows indicate movements which applied take the camera to the next conguration in the sequence (a)-(d).

Figure 4.47: Screenshot from Experiment 4.30.

Figure 4.48: Viewing transformation equivalent to a sequence of modeling transformations.

Figure 4.49: Applying a translation (1) and rotations (2)-(4) about the three coordinate axes to bring the camera back to its default pose. The original line of sight is bold. The up direction is shown only at the end.

Figure 4.50: Solution to Example 4.6: the configuration of the camera given by gluLookAt(0.0, 0.0, 0.0, 1.0, 1.0, 0.0, -1.0, 1.0, 0.0) is at left; the line of sight and up vectors are indicated by blue arrows; rotations are both annotated at the top and indicated in the figures themselves by broken arrows, the result of each rotation being the next configuration.

Figure 4.51: Screenshot of spaceTravel.cpp.

Figure 4.52: Spacecraft diagrams.

Figure 4.53: Ball rolling toward a box.

Figure 4.54: Screenshot of animateMan1.cpp.

Figure 4.55: Screenshot of animateMan1.cpp in develop mode.

Figure 4.56: Screenshot of animateMan2.cpp.

Figure 4.57: Screenshot of ballAndTorus- Shadowed.cpp.

Figure 4.58: OpenGL's synthetic-camera pipeline (highly simplified!).

Figure 4.59: Screenshot from selection.cpp.

Figure 4.60: Name stack configurations: (a) Initial (b) When the red rectangle is drawn (c) When the green rectangle is drawn.

Figure 4.61: Clicking P “hits” the aircraft because the latter intersects V’.

Figure 4.62: Screenshot of ballAndTorus- Picking.cpp moments after the ball has been clicked.

Figure 4.63: Color coding.