Exam Review Questions. Problem: A cube has vertices with world coordinates: (1, 0, 0) (2, 0, 0) (1, 1, 0) (2, 1, 0) (1, 0, 1) (2, 0, 1) (1, 1, 1) (2,

Slides:



Advertisements
Similar presentations
3D Transformations Assist. Prof. Dr. Ahmet Sayar
Advertisements

Computer Graphics: 3D Transformations
Transforming graphs of functions
Computer Graphics 2D & 3D Transformation.
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
2D Transformations x y x y x y. 2D Transformation Given a 2D object, transformation is to change the object’s Position (translation) Size (scaling) Orientation.
Introduction to 3D viewing 3D is just like taking a photograph!
Mathematical Fundamentals
CSE 381 – Advanced Game Programming 3D Mathematics
Chapter 4.1 Mathematical Concepts
Part7: Geometric Transformations
3D Viewing.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Transformations of Objects – 3D
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Perform Congruence Transformations. A __________________ is an operation that moves or changes a geometric figure to produce a new figure called an __________.
Transformations Objective: to develop an understanding of the four transformations. Starter – if 24 x 72 = 2016, find the value of: 1)2.8 x 72 = 2)2.8.
Transformation.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
WARM UP: Describe in words how to rotate a figure 90 degrees clockwise.
Geometric Transformations
Affine Transformation. Affine Transformations In this lecture, we will continue with the discussion of the remaining affine transformations and composite.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
3-D Transformational Geometry CS418 Computer Graphics John C. Hart.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
Computer Graphics Matrices
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
Ta: Ryan Freedman Sushma Kini Chi Zhou.  Pipeline  Clipping  Transformation, homogeneous coordinates  Lighting  Perspective  Viewing.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Transformations in 3D Lecture 17 Mon, Oct 6, 2003.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
Analytic geometry refreshment Szirmay-Kalos László.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Viewing Viewing and viewing space (camera space)
3D Geometric Transformation
Review: Transformations
Review: Transformations
Three-Dimensional Graphics
Lecture 2 Transformations
Chapters 5/4 part2 understanding transformations working with matrices
4-4 Geometric Transformations with Matrices
Transformations and Matrices
Transformations Translation Reflection The FRAME Routine
Transformations with Matrices
Transformations Review
Practice Test for Chapter 7 - Transformations
Presentation transcript:

Exam Review Questions

Problem: A cube has vertices with world coordinates: (1, 0, 0) (2, 0, 0) (1, 1, 0) (2, 1, 0) (1, 0, 1) (2, 0, 1) (1, 1, 1) (2, 1, 0) The eye (or camera) is at (4, 0, 0). The LookAt point is directed at (2, 0, 0). a.Sketch the cube, and locate the eye in a world coordinate system. Show the LookAt vector. Show the x,y,z axes and the origin. b.What do r, u, and v represent, and what are their values? c.Perform a viewing transformation. What are the cube vertices in viewing coordinates?

EYE (4, 0, 0) (1, 1, 0) (2, 1, 0) (2, 1, 1) (2, 0, 1) (1, 0, 1) (1, 1, 1) (2, 0, 0) (1, 0, 0) X Y Z (0, 0, 0) Sketch the cube, and locate the eye in a world coordinate system. Show the LookAt vector. Show the x,y,z axes and the origin.

EYE (4, 0, 0) (1, 1, 0) (2, 1, 0) (2, 1, 1) (2, 0, 1) (1, 0, 1) (1, 1, 1) (2, 0, 0) (1, 0, 0) X Y Z (0, 0, 0) What do r, u, v, and up represent, and what are their values? a.v is the unit vector that points from the eye to the the lookat point. a.v=(lookat-eye)/||lookat-eye|| = (-1, 0, 0) b. up points up in the world coordinate system a.up = (0, 1, 0) c.r is the unit vector orthogonal to the plane formed by the v and up vectors. a.r = v x up / || v x up|| = (0, 0, -1) d.u is the unit vector orthogonal to the plane formed by the r and v vectors a.u = r x v = (0, 1, 0)

EYE (4, 0, 0) (1, 1, 0) (2, 1, 0) (2, 1, 1) (2, 0, 1) (1, 0, 1) (1, 1, 1) (2, 0, 0) (1, 0, 0) X Y Z (0, 0, 0) To transform this to view coordinates: 1)Translate the eye point to the origin 2)Rotate the view vector onto the negative z-axis

1.Translate the eye point to the origin Eye is at (4, 0, 0). What is the translation matrix which will do that? eye_x eye_y = eye_z Now the eye is at the origin. We want the eye to look down the –z axis, so what transformation does that? rx ry rz ux uy uz 0 = vx –vy -vz | | | | |vertex_world_x] | | |vertex_world_x| | | | | |vertex_world_y| = | | |vertex_world_y| | | | | |vertex_world_z| | | |vertex_world_z| | | | | | 1 | | | | 1 | Results: (0, 0, -3, 1) (0, 0, -2, 1) (0, 1, -3, 1) (0, 1, -2, 1) (-1, 0, -3, 1) (-1, 0, -2, 1) (-1, 1, -3, 1) (0, 1,-2, 1) Where the eye at (0,0,0) looking down the negative z axis (1, 0, 0) (2, 0, 0) (1, 1, 0) (2, 1, 0) (1, 0, 1) (2, 0, 1) (1, 1, 1) (2, 1, 0)

Problem: Look at the code sample. Supply the missing keywords (marked “???”). Why did you select the keywords you did? ??? vec3 aVertexPosition; ??? vec4 aVertexColor; ??? mat4 uMVMatrix; ??? vec4 vColor; void main(void) { gl_Position = uMVMatrix*vec4(aVertexPosition, 1.0); vColor = aVertexColor; } precision mediump float; ??? vec4 vColor; void main(void) { gl_FragColor = vColor; }

Problem: Look at the code sample. Supply the missing keywords. attribute vec3 aVertexPosition; attribute vec4 aVertexColor; uniform mat4 uMVMatrix; varying vec4 vColor; void main(void) { gl_Position = uMVMatrix*vec4(aVertexPosition, 1.0); vColor = aVertexColor; } precision mediump float; varying vec4 vColor;void main(void) { gl_FragColor = vColor; }

Problem: In a right handed world coordinate system where the x and y are horizontal axes and z is the vertical axis, with positive z in the up direction, let the eye be at the point (3,4,5) looking at the point (3,6,5). Indicate the viewing transformation below for viewing coordinates with the eye at the origin looking down the negative z axis, as the product of rotation and translation matrices. You should use Rotate x (θ) (or Rotate y (θ) / Rotate z (θ)) to denote a 4x4 homogeneous rotation matrix about x axis (or y / z) by θ degrees, and T(a,b,c) to denote a 4x4 homogeneous translation matrix in the direction (a,b,c). (Hint: show your work. Draw pictures. Take your time. Use your right hand.)

X Z -Y (0, 0, 0) (3,6,5) lookat (3,4,5) eye

Problem: In a right handed world coordinate system where the x and y are horizontal axes and z is the vertical axis, with positive z in the up direction, let the eye be at the point (3,4,5) looking at the point (3,6,5). Indicate the viewing transformation below for viewing coordinates with the eye at the origin looking down the negative z axis, as the product of rotation and translation matrices. You should use Rotate x (θ) (or Rotate y (θ) / Rotate z (θ)) to denote a 4x4 homogeneous rotation matrix about x axis (or y / z) by θ degrees, and T(a,b,c) to denote a 4x4 homogeneous translation matrix in the direction (a,b,c). (Hint: show your work. Draw pictures. Take your time. Use your right hand.) Step 1: Translate the eye to the origin T(-3, -4, -5) eye_x eye_y = eye_z X -Y (0, 0, 0) (3,6,5) lookat (3,4,5) eye Z

Problem: In a right handed world coordinate system where the x and y are horizontal axes and z is the vertical axis, with positive z in the up direction, let the eye be at the point (3,4,5) looking at the point (3,6,5). Indicate the viewing transformation below for viewing coordinates with the eye at the origin looking down the negative z axis, as the product of rotation and translation matrices. You should use Rotate x (θ) (or Rotate y (θ) / Rotate z (θ)) to denote a 4x4 homogeneous rotation matrix about x axis (or y / z) by θ degrees, and T(a,b,c) to denote a 4x4 homogeneous translation matrix in the direction (a,b,c). (Hint: show your work. Draw pictures. Take your time. Use your right hand.) X Z - Y (0, 0, 0) eye Step 2: At this point the eye has been translated to the origin. Rotate everything into the negative z axis. lookat Intuitively… what do you need to do to this picture to have the eye looking at the lookat point down the negative z axis? Rotate clockwise around x by 90 degrees. Which is a negative rotation around x. Rotate x (-90) (0, 2, 0) (After translation to origin)

Problem: In a right handed world coordinate system where the x and y are horizontal axes and z is the vertical axis, with positive z in the up direction, let the eye be at the point (3,4,5) looking at the point (3,6,5). Indicate the viewing transformation below for viewing coordinates with the eye at the origin looking down the negative z axis, as the product of rotation and translation matrices. You should use Rotate x (θ) (or Rotate y (θ) / Rotate z (θ)) to denote a 4x4 homogeneous rotation matrix about x axis (or y / z) by θ degrees, and T(a,b,c) to denote a 4x4 homogeneous translation matrix in the direction (a,b,c). (Hint: show your work. Draw pictures. Take your time. Use your right hand.) X Z Y (0, 0, 0) eye lookat (0, 0, -2) (After translation to origin) * T(-3, -4, -5)Viewing Xform = Rotate x (-90) What is the viewing transform?

Problem: The polygon below can be drawn as a triangle strip. List the vertices in the order as they are used to draw the polygon.

1: F, C, B, E, D, A 2: A, D, E, B, C, F

Problem: 3D transformation. Find a transformation matrix that will simultaneously squash by ½ along the z axis and stretch by 5 along the x axis.

Problem: 3D transformation. Find a transformation matrix that will simultaneously squash by ½ along the z axis and stretch by 5 along the x axis |a 0 0 0| |x| |ax| |0 b 0 0| |y| = |by| |0 0 c 0| |z| |cy| | | |1| |1 | | | | | | | | |

Problem: 3D transformation. Find a transformation matrix which performs: Rotation of 90 around the z axis, then translate by 5 units along the y axis, then scales the object by 2 units in all directions.

Rotation of 90 degrees around z: (1 st transformation, T1) |cos90 -sin90 0 0| | | |sin90 cos90 0 0| = | | | | | | | | | |

Problem: 3D transformation. Find a transformation matrix which performs: Rotation of 90 around the z axis, then translate by 5 units along the y axis, then scales the object by 2 units in all directions. Translate 5 units along y axis: (2nd transformation, T2) |1 0 0 a| | | |0 1 0 b| = | | | | | | | | | |

Problem: 3D transformation. Find a transformation matrix which performs: Rotation of 90 around the z axis, then translate by 5 units along the y axis, then scales the object by 2 units in all directions. Scale by 2 on all axes: (3rd transformation, T3) |a 0 0 0| | | |0 b 0 0| = | | |0 0 c 0| | | | | | |

Problem: 3D transformation. Find a transformation matrix which performs: Rotation of 90 around the z axis, then translate by 5 units along the y axis, then scales the object by 2 units in all directions. Put them all together. First rotate, then translate, then scale. Note the order that produces this. T3 T2 T1

Problem: 3D transformation. Supposed a triangle has a normal vector of and that the vector for the viewing direction is. Is the triangle front facing or back facing?

Problem: 3D transformation. Supposed a triangle has a normal vector of and that the vector for the viewing direction is. Is the triangle front facing or back facing? Take the dot product. Is the dot product positive or negative? Positive A positive dot product indicates a back facing polygon. (The view vector runs in the direction of eyepoint to the polygon) Therefore the triangle is back facing.