Viewing Viewing and viewing space (camera space)

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

GR2 Advanced Computer Graphics AGR
GR2 Advanced Computer Graphics AGR
Three Dimensional Viewing
3.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 3 Viewing Transformation Getting Started with OpenGL Introduction to Projections.
Viewing Transformations
Introduction to 3D viewing 3D is just like taking a photograph!
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
Advanced Computer Graphics Three Dimensional Viewing
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Camera. Content Coordinate systems and transformations Viewing coordinates Coordinate transformation matrix Projections Window and viewport Acknowledgments:
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
3D Viewing ( From 3D to 2D) Some of the material in these slides have been adapted from the lecture notes of Prof. Tao Ju from Washington University in.
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.
Geometric Transformations
Three-Dimensional Viewing
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Projection.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Projections Angel: Interactive Computer Graphics.
Lecture 5: Introduction to 3D
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
CS-321 Dr. Mark L. Hornick 1 Three-Dimensional Graphics Problem How can you effectively display 3-D information on a 2-D display?
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Lecture 19 PROJECTIONS I Taqdees A. Siddiqi
Outline 3D Viewing Required readings: HB 10-1 to 10-10
Computer Graphics Projections.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Perspective projection
Rendering Pipeline Fall, 2015.
Computer Graphics CC416 Week 14 3D Graphics.
3D Geometric Transformation
Computer Graphics CC416 Week 15 3D Graphics.
Viewing System 한신대학교 류승택.
PERSPECTIVE PROJECTION…...
Projection Our 3-D scenes are all specified in 3-D world coordinates
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
Viewing in 3D Chapter 6.
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.
3D Transformation Pipeline
CENG 477 Introduction to Computer Graphics
CSC461: Lecture 19 Computer Viewing
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Chapter IV Spaces and Transforms
Three-Dimensional Viewing
Clip against view volume Project onto projection plane
Chapter V Vertex Processing
Last Time Canonical view pipeline Projection Local Coordinate Space
3D Graphics.
Chap 3 Viewing Pipeline Reading:
Orthogonal Base Cartesian Coordinate System Works in general:
Viewing (Projections)
3D Viewing.
THREE-DIMENSIONAL VIEWING II
THREE-DIMENSIONAL VIEWING
The View Matrix Lecture 20 Mon, Oct 24, 2005.
The Pinhole Camera Model
Guilford County SciVis V part 1
Presentation transcript:

Viewing Viewing and viewing space (camera space) World space to viewing space transformation

World to Viewing Coordinates Graphics display devices are 2D rectangular screens. Hence we need to understand how to transform our 3D world to a 2D surface Viewing the desired scene is analogous to taking pictures using a camera We now need to world coordinates viewing VIEWING TRANSFORMATION 4 4

Camera Analogy View is described in terms of: camera position in world coordinate system camera direction (viewing direction) camera orientation: usually defined by the up vector aperture size: field of view

View Coordinate System specify a view reference point in the world coordinate system. This can be any point along the camera direction, or the camera position itself specify the view plane normal N - this gives the camera, or Z direction specify the view-up direction, V - this gives the camera up direction, or Y direction xW yW zW P0 N V xW yW zW P0 N xW yW zW P0 v’ v n v=v’-(v.n) n 5 5

Viewing Coordinate System We can construct a vector U perpendicular to both V and N, and this will correspond to the Xv axis. How? We can define U as right, V as up, and N as towards the viewer: a right handed system UV=N We can also define U as right, V as up and N as into the scene: a left handed system VU=N, in which bigger N values mean points are further away OpenGL is right handed P0 N V U yW xW zW 8 8

View Coordinate System Some systems (e.g., OpenGL) allow you to specify a ‘look at’ point, Q, from which N is calculated as the direction to the ‘look at’ point from the view reference point xW yW zW P0 Q 6 6

World to Viewing Objects must be viewed in the viewing space This can be done by aligning the view coordinate system with world coordinate system, e.g., view reference point is transformed to world origin, and U, V, N are aligned with X, Y, Z directions through rotations y (x0, y0, z0) x z 9 9

x y z World to Viewing Translate view origin to world origin, then align U, V and N axes with X, Y and Z directions by rotation R = Rz. Ry. Rx rotate around X to bring N into the X-Z plane rotate around Y to align N with Z rotate around Z to align V with Y An easier way to work out the rotation matrix R: U in world space should be (1,0,0) in view space V should be (0,1,0) N should be (0,0,1) So we have the following equations 1. R*(Ux, Uy, Uz,1)T = (1,0,0,1) 2. R*(Vx, Vy, Vz,1)T = (0,1,0,1) 3. R*(Nx, Ny, Nz,1)T = (0,0,1,1) P0 N V U Ux Uy Uz 1 (Ux, Uy, Uz,1)T = 11 11

World to Viewing Transformation Remember U.U=1, U.V=0, U.N=0, V.N=0, so if we choose the rotation matrix as The equations 1,2,3 will be satisfied The rotation matrix is a “change of basis” matrix So viewing transformation from world space to viewing space is: M = RT R =

What’s Pw in viewing coordinates? x y z u v n (0,0,1) Pw=(1,1,0) Intuitively, P in viewing coordinate is (-1,1,1), but how do we derive it? 1. Translate view origin to world origin with translation vector (0, 0, -1) 2. Multiply Pw by matrix M below to align viewing axes with world axes -1 0 0 0 M = 0 1 0 0 0 0 -1 1 So Pw in viewing space is: Pv = M T Pw u, v, n in world space: u=(-1,0,0) v=(0,1,0) n=(0,0,-1)

OpenGL Viewing Coordinate System The default camera is placed at the coordinate origin of world space (U aligned with the X axis, V aligned with Y, and N aligned with Z), looking along the negative z-direction, and the view plane is perpendicular to the viewing direction xv yv zv 6

Projection We need to transform from a special viewing coordinate system (camera on z-axis pointing along the axis) into a projection coordinate system viewing coordinates PROJECTION TRANSFORMATION projection coordinates 3 3

Parallel Projection - Two types In parallel projection, the observer position is at an infinite distance, so the projection lines are parallel Orthographic parallel projection has view plane perpendicular to direction of projection Oblique parallel projection has view plane at an oblique angle to direction of projection P1 P2 view plane 14

Parallel Projection Calculation xv yv zv looking along x-axis P (x,y,z) (xp,yp,d) yV viewing space d o - zV view plane yP = y Similarly, xP = x 15

Parallel Projection Calculation So x = xp y = yp z = d The projection transformation matrix is simply If view plane is xoy plane, Then d=0 xp yp d 1 1 0 0 0 0 1 0 0 0 0 d/z 0 0 0 0 1 x y z 1 = projection space projection matrix viewing space 17

Perspective Projection In a perspective projection, object positions are projected onto the view plane along lines which converge at the observer, or Centre of Projection (COP) Perspective projection gives realistic views, but does not preserve proportions - projections of distant objects are smaller than projections of objects of the same size which are closer to the view plane (fore-shortening) P1 P2 P1’ P2’ view plane camera 3