Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Defining the Viewing Coordinate System
Three Dimensional Viewing
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
Three Dimensional Modeling Transformations
Kinematic Modelling in Robotics
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
Based on slides created by Edward Angel
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.
3-D Geometry.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Screw Rotation and Other Rotational Forms
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Informationsteknologi Wednesday, November 14, 2007Computer Graphics - Class 81 Today’s class Orthogonal matrices Quaternions Shears Synthetic camera Viewing.
Introduction to 3D viewing 3D is just like taking a photograph!
3D VIEWING ILLUSTRATED. WHAT YOU SEE DEPENDS ON YOUR POSITION In the real world, what you see depends on where you stand, the direction you look, how.
Viewing and Projections
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Computer Graphics (fall 2009)
Advanced Computer Graphics Three Dimensional Viewing
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Fundamentals of Computer Graphics Part 5 Viewing prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Computer Graphics I, Fall 2010 Computer Viewing.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
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.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Three-Dimensional Viewing
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
End effector End effector - the last coordinate system of figure Located in joint N. But usually, we want to specify it in base coordinates. 1.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
CS 490: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Viewing Viewing and viewing space (camera space)
Viewing.
Computer Viewing.
Computer Graphics CC416 Week 15 3D Graphics.
Isaac Gang University of Mary Hardin-Baylor
3D Viewing cgvr.korea.ac.kr.
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.
CSC461: Lecture 19 Computer Viewing
Computer Graphics : Viewing in 3D_4
Fundamentals of Computer Graphics Part 5 Viewing
Three Dimensional Viewing
3D Graphics.
Chap 3 Viewing Pipeline Reading:
University of New Mexico
Viewing (Projections)
Interactive Computer Graphics Viewing
Computer Graphics Computer Viewing
THREE-DIMENSIONAL VIEWING
Computer Viewing Ed Angel Professor Emeritus of Computer Science
Viewing Transformations II
CS 352: Computer Graphics Chapter 5: Viewing.
Presentation transcript:

Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I

Viewing Viewing refers to positioning the camera in a coordinate frame and projection of the 3D object onto the 2D image plane of the camera. Positioning the camera is very similar to positioning an object. Moving the camera relative to an object is the same as moving the object relative to the camera, in the opposite direction. In openGL the modeling and viewing transformations are combined into one transformation matrix. First the object is positioned by multiplying the vertices by the object transformation matrices. Then the camera is positioned by multiplying by camera transformation matrices.

Default Position of Camera The default camera position is centered at the origin, pointing along the negative Z axis. If we create an object (e.g. a cube) centered on the origin, part of it will be behind the camera. To gain a view of the entire object, we need to move the camera by a distance, d, along the positive Z axis. This is equivalent to moving the object by a distance, -d, along the negative Z axis.

Moving the camera backward Object Frame y' y translate(0.0, 0.0, -d) x' x y z' d z x z Camera Frame

Looking at the side of an Object To move the camera to look at the side of an object that is centered on the origin: 1. Rotate the camera 90 deg. (Equivalent to rotating the object by -90 deg) 2. Translate the camera backward along +Z axis. (Equivalent to translating the object along -Z axis) mvMatrix = translate(0.0, 0.0, -d); mvMatrix = mult(mvMatrix, rotate(-90.0, 0.0, 1.0, 0.0));

Isometric view of a cube The isometric view of a cube, is one in which the projection plane is placed symmetrically with respect to 3 faces of the cube. We can gain an isometric view by rotating the camera (or cube centered on the origin), first about the Y axis and then about the X axis. We then translate the camera backward to view it. M = TRxRy

Rotation matrix for Rotation about the Y axis 1. Rotate the cube 45 deg about the Y axis. 2 x z Top-down view after 45 deg rotation Ry = ?

Rotation Matrix for Rotation about Y axis 2. Rotate about the X Axis: y 1 z q Slice through Y-Z plane. (Through diagonal of cube) Rx = ?

Translate along -Z axis 3. Translate by -d along Z axis. Final Matrix: M = TRxRy

The UVN System Other graphics systems may define the camera viewing plane differently. The U-V-N system is one example: The camera plane is defined by 3 parameters: View Reference Point (VRP): A point (in the world frame) indicating the center of the camera's image plane. This specifies the position of the camera in space. View Plane Normal (VPN): A unit vector perpendicular to the camera's image plane. This specifies the orientation of the camera. View Up (VUP): A vector indicating the up direction (in world coordinates) for the camera.

The UVN vector coordinates VUP n v VUP does not have to lie in the image plane. u The projection of VUP onto the image plane is v. v is perpendicular to n. These define 2 of our three basis vectors for the camera coordinate system. We define a third basis vector, u, such that u = v x n. Together, u, v and n make up the camera coordinate system.

The look-at function The look-at function allows the camera to remain aimed at a given point even as its position in the world changes. The camera is centered at the eye (VRP = e) The camera is pointed at the "at" point (VPN = a - e) The up vector (VUP) must be defined to specify the camera orientation. a VPN e In MV.js: function lookAt( eye, at, up )

Yaw, Pitch and Roll y y y z x z x Roll Pitch x q q x z x Camera in nose of plane. Roll Pitch x In flight simulators, the angles of rotation are about the center of mass of the airplane. The camera is in the nose of the plane. q z Yaw

Parallel projections In parallel projections, the lines projecting from an object onto the image plane are parallel. Two parallel projection systems: Orthographic projection: Projection lines are perpendicular to the image plane. Oblique projection: The view plane is tilted so the projection lines are not perpendicular to the plane. x x z z Orthographic Oblique

Matrix for Orthographic Projection xp = x yp = y zp = 0 M = ? p'= Mp = ?

Perspective Projection y x (X, -Z) (xp, -d) (Y, -Z) (yp, -d) -z -d -d -z

Matrix for Perspective Projection Representation of a point, P, in homogeneous coordinates: Perspective projection Matrix: