Computer Graphics. Lecture 04 3D Projection and Visualization. Edirlei Soares de Lima.
|
|
- Sarah Wood
- 5 years ago
- Views:
Transcription
1 Computer Graphics Lecture 4 3D Projection and Visualization Edirlei Soares de Lima <edirlei.lima@universidadeeuropeia.pt>
2 Projection and Visualization An important use of geometric transformations in computer graphics is in moving objects between their 3D locations and their positions in a 2D view of the 3D world. This 3D to 2D mapping is called a viewing transformation or projection.
3 Viewing Transformations The viewing transformation has the objective of mapping 3D coordinates (represented as [x, y, z] in the canonical coordinate system) to coordinates in the screen (expressed in units of pixels). Important factors: camera position and orientation, type of projection, screen resolution, field of view. Transformations: Camera Transformation: converts points in canonical coordinates (or world space) to camera coordinates; Projection Transformation: moves points from camera space to the canonical view volume; Viewport Transformation: maps the canonical view volume to screen space.
4 Viewing Transformations
5 Viewing Transformations Orthographic Projection: can be done by ignoring z-coordinate. Perspective Projection: simplified model of human eye, or camera lens (pinhole camera).
6 Viewing Transformations Orthographic Projection vs Perspective Projection
7 Viewing Transformations
8 Viewport Transformation The viewport transformation maps the canonical view volume to screen space. The canonical view volume is a cube containing all 3D points whose coordinates are between 1 and +1 (i.e. (x, y, z) [ 1, 1]). Considering a screen of n x by n y pixels, we need to map the square [ 1, 1] to the rectangle [, n x ] [, n y ].
9 Viewport Transformation Viewport transformation is windowing transformation that can be accomplished with three operations (2D example): 1. Move the points (x l, y l ) to the origin. 2. Scale the rectangle to be the same size as the target rectangle. 3. Move the origin to point (x l, y l ).
10 Viewport Transformation These operations can be represented as multiplications of matrices (2D example): T = 1 x l 1 y l 1 x h x l x h x l y h y l y h y l 1 1 x l 1 y l 1 T = x h x l x l x h x h x l x h x l x h x l y h y l y l y h y h y l y h y l y h y l 1
11 Viewport Transformation Back to our 3D problem: map the canonical view volume to screen space. x screen y screen 1 = n x n x n y n y In homogeneous coordinates: x canonical y canonical 1 M vp = n x 2 n x 1 2 n y n y (, n y ) (n x, n y ) keeps the z-coordinate (,) (n x, )
12 Viewing Transformations
13 Projection Transformation The projection transformation moves points from camera space to the canonical view volume. This is a very important step, because we usually want to render geometry in some region of space other than the canonical view volume. The simplest type of projection is parallel projection, in which 3D points are mapped to 2D by moving them along a projection direction until they hit the image plane. In the orthographic projection, the image plane is perpendicular to the view direction.
14 Orthographic Projection Our first step in generalizing the view will keep the view direction and orientation fixed looking along z with +y up, but will allow arbitrary rectangles to be viewed. The orthographic view volume is an axis-aligned box [l, r] [b, t] [f, n]. x = l left plane x = r right plane y = b bottom plane y = t top plane z = n near plane z = f far plane
15 Orthographic Projection We assume a viewer who is looking along the minus z-axis with his head pointing in the y-direction. This implies that n > f. How can we transform points that are inside of the orthographic view volume to the canonical view volume? This transform is another windowing transformation!
16 Orthographic Projection Orthographic projection matrix: M orth = 2 r l r + l r l 2 t + b t b t b 2 n + f n f n f 1 The M orth matrix can be combined with M vp matrix to transform points to screen coordinates: x screen y screen z cannonical 1 = M vp M orth x y z 1
17 Orthographic Projection Now we can start the implementation of the code to draw objects on screen (only lines): construct M vp construct M orth M = M vp M orth for each line segment (a i, b i ) do p = Ma i q = Mb i drawline(x p, y p, x q, y q ) In order to test the orthographic projection in Unity, first we need to simulate the world space and create the mesh of a 3D object.
18 ... p7 p6 public class World : MonoBehaviour{ private Mesh mesh; public Vector3[] vertices; public int[] lines; p4 p3 p5 p2 void Start() p { mesh = new Mesh(); GetComponent<MeshFilter>().mesh = mesh; mesh.name = "MyMesh"; Vector3 p = new Vector3(-1f, -1f, -1f); Vector3 p1 = new Vector3(1f, -1f, -1f); Vector3 p2 = new Vector3(1f, -1f, -3f); Vector3 p3 = new Vector3(-1f, -1f, -3f); Vector3 p4 = new Vector3(-1f, 1f, -1f); Vector3 p5 = new Vector3(1f, 1f, -1f); Vector3 p6 = new Vector3(1f, 1f, -3f); Vector3 p7 = new Vector3(-1f, 1f, -3f); p1...
19 p7 p6... p4 p5 vertices = new Vector3[] { // Bottom p, p1, p2, p3, // Left p7, p4, p, p3, // Front p4, p5, p1, p, // Back p6, p7, p3, p2, // Right p5, p6, p2, p1, // Top p7, p6, p5, p4 }; p p3 p1 p2...
20 p7 p6... p4 p5 int[] triangles = new int[] { 3, 1,, // Bottom 3, 2, 1, 7, 5, 4, // Left 7, 6, 5, 11, 9, 8, // Front 11, 1, 9, 15, 13, 12, // Back 15, 14, 13, 19, 17, 16, // Right 19, 18, 17, 23, 21, 2, // Top 23, 22, 21, }; p p3 p1 p2...
21 ... lines = new int[] {, 1,, 3,, 5, 1, 2, 1, 9, 2, 3, 2, 12, 3, 4, 5, 9, 5, 4, 9, 12, 12, 4 }; p4 p p7 p3 p1 p5 p6 p2 } } mesh.vertices = vertices; mesh.triangles = triangles; mesh.recalculatenormals();
22 Orthographic Projection After simulating the world space, we need to: Define the orthographic view volume; Construct the M vp and M orth matrices; Draw the objects in screen space. n x n x n M vp = y n x M orth = 2 r l r + l r l 2 t + b t b t b 2 n + f n f n f 1 orthographic view volume
23 ... public class ViewTrasform : MonoBehaviour { public World world; private float left_plane = 5f; private float right_plane = -5f; private float botton_plane = -5f; private float top_plane = 5f; private float near_plane = -1f; private float far_plane = -11f;...
24 ... void OnGUI() { Matrix4x4 mvp = new Matrix4x4(); mvp.setrow(,new Vector4(Screen.width/2f,f,f,(Screen.width-1)/2f)); mvp.setrow(1,new Vector4(f,Screen.height/2f,f,(Screen.height-1)/2f)); mvp.setrow(2,new Vector4(f, f, 1f, f)); mvp.setrow(3,new Vector4(f, f, f, 1f)); Matrix4x4 morth = new Matrix4x4(); morth.setrow(, new Vector4(2f / (right_plane - left_plane), f, f, -((right_plane+left_plane)/(right_plane-left_plane)))); morth.setrow(1, new Vector4(f, 2f / (top_plane - botton_plane), f, -((top_plane + botton_plane) / (top_plane - botton_plane)))); morth.setrow(2, new Vector4(f, f, 2f / (near_plane - far_plane), -((near_plane + far_plane) / (near_plane - far_plane)))); morth.setrow(3, new Vector4(f, f, f, 1f)); Matrix4x4 m = mvp * morth;...
25 ... for (int i = ; i < world.lines.length; i+=2) { Vector4 p = multiplypoint(m, new Vector4(world.vertices[world.lines[i]].x, world.vertices[world.lines[i]].y, world.vertices[world.lines[i]].z, 1)); Vector4 q = multiplypoint(m, new Vector4(world.vertices[world.lines[i + 1]].x, world.vertices[world.lines[i + 1]].y, world.vertices[world.lines[i + 1]].z, 1)); GuiHelper.DrawLine(new Vector2(p.x, p.y), new Vector2(q.x, q.y), Color.black); } }
26 Matrix by Point Multiplication Vector4 multiplypoint(matrix4x4 matrix, Vector4 point) { Vector4 result = new Vector4(); for (int r = ; r < 4; r++) { float s = ; for (int z = ; z < 4; z++) s += matrix[r, z] * point[z]; result[r] = s; } return result; } Note: we could also use the function Matrix4x4.MultiplyPoint(Vector3 point), but it multiplies the matrix by a Vector3 and returns another Vector3. For now this is not a problem, but it will be a problem when we need the w coordinate to do perspective projection.
27 Exercise 1 1) How do you know that the resulting rectangle on screen is correct? Use the rotation transformations to rotate the object and see if it looks 3D.
28 Viewing Transformations
29 Camera Transformation The camera transformation converts points in world space to camera coordinates. This transformation allow us to change the viewpoint in 3D and look in any direction. Camera specification: Eye position (e): location that the eye sees from ; Gaze direction (g): vector in the direction that the viewer is looking; View-up vector (t): vector in the plane that both bisects the viewer s head into right and left halves (for a person standing on the ground, it points to the sky ).
30 Camera Transformation The camera vectors provide enough information to set up a coordinate system with origin e and a uvw basis. w = g g u = t w t w v = u w
31 Camera Transformation After set up the coordinate system with origin e and a uvw basis, we need to convert the coordinates of the objects from xyz-coordinates into uvw-coordinates. Step 1: Translate e to the world origin (,, ); T = 1 x e 1 y e 1 w e 1 Step 2: Rotate uvw to align it with xyz; R = x u y u z u x v y v z v x w y w z w 1
32 Camera Transformation After set up the coordinate system with origin e and a uvw basis, we need to convert the coordinates of the objects from xyz-coordinates into uvw-coordinates. M cam = x u y u z u x v y v z v x w y w z w 1 1 x e 1 y e 1 w e 1 M cam = x u y u z u (x u x e + y u y e + z u z e ) x v y v z v (x v x e + y v y e + z v z e ) x w y w z w (x w x e + y w y e + z w z e ) 1
33 Camera Transformation Now we can make the viewing algorithm work for cameras with any location and orientation. The camera transformation is added to the product of the viewport and projection transformations, so that it converts the incoming points from world to camera coordinates before they are projected. construct M vp construct M orth construct M cam M = M vp M orth M cam for each line segment (a i, b i ) do p = Ma i q = Mb i drawline(x p, y p, x q, y q )
34 Camera Transformation In order to add the camera transformation to our implementation in Unity, first we define the camera properties:... public class ViewTrasform : MonoBehaviour {... public Vector3 eye; public Vector3 gaze; public Vector3 up;...
35 ... Vector3 w = -gaze.normalized; Vector3 u = Vector3.Cross(up, w).normalized; Vector3 v = Vector3.Cross(w, u); Matrix4x4 mcam = new Matrix4x4(); mcam.setrow(, new Vector4(u.x, u.y, u.z, -((u.x * eye.x) + (u.y * eye.y) + (u.z * eye.z)))); mcam.setrow(1, new Vector4(v.x, v.y, v.z, -((v.x * eye.x) + (v.y * eye.y) + (v.z * eye.z)))); mcam.setrow(2, new Vector4(w.x, w.y, w.z, -((w.x * eye.x) + (w.y * eye.y) + (w.z * eye.z)))); mcam.setrow(3, new Vector4(,,, 1)); UpdateViewVolume(eye); Matrix4x4 m = mvp * (morth * mcam);... Update the position of the view volume based on the camera position.
36 ... void UpdateViewVolume(Vector3 e) { near_plane = e.z - 3; far_plane = e.z - 13; right_plane = e.x - 5; left_plane = e.x + 5; top_plane = e.y + 5; botton_plane = e.y - 5; }... Not the best solution!!!
37 Perspective Projection Perspective projection models how we see the real world. Objects appear smaller with distance.
38 Perspective Projection The key property of perspective is that the size of an object on the screen is proportional to 1/z for an eye at the origin looking up the negative z-axis. 2D Example: y s = d z y y is the distance of the point along the y-axis. y s is where the point should be drawn on the screen.
39 Perspective Projection In order to implement perspective projection as a matrix multiplication (in which one of the coordinates of the input vector appears in the denominator), we can rely on a generalization of the homogeneous coordinates: In homogeneous coordinates, we represent the point x, y, z as [x, y, z, 1], where the extra coordinate w is always equal to 1. Rather than just thinking of the 1 as an extra piece in the matrix multiplication to implement translation, we now define it to be the denominator of the x-, y-, and z-coordinates: x, y, z, w x w, y w, z w
40 Perspective Projection The perspective matrix maps the Perspective View Volume (which is shaped like a frustum or pyramid) to the Orthographic View Volume (which is an axis-aligned box). P = n n n + f 1 fn M per = M orth P M per = 2n r l 2n t b l + r l r b + t b t f + n n f 1 2fn f n
41 View Volumes
42 Perspective Projection To integrate the perspective matrix into our implementation, we simply replace M orth with M per, which inserts the perspective matrix P after the camera matrix M cam has been applied: M = M vp M orth PM cam
43 Perspective Projection To integrate the perspective matrix into our implementation, we simply replace M orth with M per, which inserts the perspective matrix P after the camera matrix M cam has been applied: M = M vp M orth PM cam The resulting algorithm is: construct M vp construct M per construct M cam M = M vp M per M cam for each line segment (a i, b i ) do p = Ma i q = Mb i drawline(x p /w p, y p /w p, x q /w q, y q /w q )
44 ... Matrix4x4 mper = new Matrix4x4(); mper.setrow(, new Vector4(near_plane, f, f, f)); mper.setrow(1, new Vector4(f, near_plane, f, f)); mper.setrow(2, new Vector4(f, f, near_plane + far_plane, -(far_plane * near_plane))); mper.setrow(3, new Vector4(f, f, 1f, f));... Matrix4x4 m = mvp * ((morth * mper) * mcam); for (int i = ; i < world.lines.length; i+=2) { Vector4 p = multiplypoint(m, new Vector4(world.vertices[world.lines[i]].x, world.vertices[world.lines[i]].y, world.vertices[world.lines[i]].z, 1)); Vector4 q = multiplypoint(m, new Vector4(world.vertices[world.lines[i + 1]].x, world.vertices[world.lines[i + 1]].y, world.vertices[world.lines[i + 1]].z, 1)); GuiHelper.DrawLine(new Vector2(p.x/p.w, p.y/p.w), new Vector2(q.x/q.w, q.y/q.w), Color.black); }...
45 Exercise 2 2) The implementation of the Perspective Projection is creating M per by multiplying M orth and P, which is not the most efficient way of performing the perspective projection. Change the code in order to use the final product of the matrices: M per = M orth P = 2n r l 2n t b l + r l r b + t b t f + n n f 1 2fn f n
46 Field-of-View As the orthographic view volume, the perspective view volume can be defined by 6 parameters, in camera coordinates: Left, right, top, bottom, near, far. However, sometimes we would like to have a simpler system where we look through the center of the window. right = left botton = top n x = right n y top tan θ 2 = top near
47 Field-of-View With the simplified system, we have only 4 parameters: Field-of-view (θ); Image aspect ratio (screen width/height); Near, and far clipping planes; M per = 1 tan θ aspect 1 tan(θ) f + n n f 1 2fn f n
48 Exercise 3 3) Implement the simplified perspective view volume with fieldof-view in Unity. θ must be converted to radians. M per = 1 tan θ aspect 1 tan(θ) f + n n f 1 2fn f n
49 Further Reading Hughes, J. F., et al. (213). Computer Graphics: Principles and Practice (3rd ed.). Upper Saddle River, NJ: Addison-Wesley Professional. ISBN: Chapter 13: Camera Specifications and Transformations Marschner, S., et al. (215). Fundamentals of Computer Graphics (4th ed.). A K Peters/CRC Press. ISBN: Chapter 8: Viewing
Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.
Computer Graphics Lecture 02 Graphics Pipeline Edirlei Soares de Lima What is the graphics pipeline? The Graphics Pipeline is a special software/hardware subsystem
More information3D Viewing. CS 4620 Lecture 8
3D Viewing CS 46 Lecture 8 13 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene projects to pixel explicitly construct
More informationCSC 305 The Graphics Pipeline-1
C. O. P. d y! "#"" (-1, -1) (1, 1) x z CSC 305 The Graphics Pipeline-1 by Brian Wyvill The University of Victoria Graphics Group Perspective Viewing Transformation l l l Tools for creating and manipulating
More information3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9
3D Viewing CS 46 Lecture 9 Cornell CS46 Spring 18 Lecture 9 18 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene
More informationCS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside
CS230 : Computer Graphics Lecture 6: Viewing Transformations Tamar Shinar Computer Science & Engineering UC Riverside Rendering approaches 1. image-oriented foreach pixel... 2. object-oriented foreach
More informationGraphics 2009/2010, period 1. Lecture 6: perspective projection
Graphics 2009/2010, period 1 Lecture 6 Perspective projection Orthographic vs. perspective projection Introduction Projecting from arbitrary camera positions Orthographic projection and the canonical view
More informationCS 4204 Computer Graphics
CS 4204 Computer Graphics 3D Viewing and Projection Yong Cao Virginia Tech Objective We will develop methods to camera through scenes. We will develop mathematical tools to handle perspective projection.
More informationGeometry: Outline. Projections. Orthographic Perspective
Geometry: Cameras Outline Setting up the camera Projections Orthographic Perspective 1 Controlling the camera Default OpenGL camera: At (0, 0, 0) T in world coordinates looking in Z direction with up vector
More informationIntroduction to Computer Graphics 4. Viewing in 3D
Introduction to Computer Graphics 4. Viewing in 3D National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 5 th Ed., Addison Wesley Ref: Hearn
More informationProf. Feng Liu. Fall /19/2016
Prof. Feng Liu Fall 26 http://www.cs.pdx.edu/~fliu/courses/cs447/ /9/26 Last time More 2D Transformations Homogeneous Coordinates 3D Transformations The Viewing Pipeline 2 Today Perspective projection
More informationOpenGL Transformations
OpenGL Transformations R. J. Renka Department of Computer Science & Engineering University of North Texas 02/18/2014 Introduction The most essential aspect of OpenGL is the vertex pipeline described in
More informationLecture 9 Sections 2.6, 5.1, 5.2. Wed, Sep 16, 2009
Lecture 9 Sections 2.6, 5.1, 5.2 Hampden-Sydney College Wed, Sep 16, 2009 Outline 1 2 3 4 5 6 Controlling 7 Definition () A frustum is a truncated pyramid. Definition ( ) The view frustum is the region
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationCSE452 Computer Graphics
CSE45 Computer Graphics Lecture 8: Computer Projection CSE45 Lecture 8: Computer Projection 1 Review In the last lecture We set up a Virtual Camera Position Orientation Clipping planes Viewing angles Orthographic/Perspective
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationVirtual Cameras and The Transformation Pipeline
Virtual Cameras and The Transformation Pipeline Anton Gerdelan gerdela@scss.tcd.ie with content from Rachel McDonnell 13 Oct 2014 Virtual Camera We want to navigate through our scene in 3d Solution = create
More informationCSE528 Computer Graphics: Theory, Algorithms, and Applications
CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu
More informationCSE328 Fundamentals of Computer Graphics
CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu
More informationOverview. By end of the week:
Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric
More informationThe View Frustum. Lecture 9 Sections 2.6, 5.1, 5.2. Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2011
The View Frustum Lecture 9 Sections 2.6, 5.1, 5.2 Robb T. Koether Hampden-Sydney College Wed, Sep 14, 2011 Robb T. Koether (Hampden-Sydney College) The View Frustum Wed, Sep 14, 2011 1 / 36 Outline 1 The
More informationComputer Graphics. Chapter 10 Three-Dimensional Viewing
Computer Graphics Chapter 10 Three-Dimensional Viewing Chapter 10 Three-Dimensional Viewing Part I. Overview of 3D Viewing Concept 3D Viewing Pipeline vs. OpenGL Pipeline 3D Viewing-Coordinate Parameters
More informationComputer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York
Computer Viewing Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing
More informationProjection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection
Projection: Mapping 3-D to 2-D Our scene models are in 3-D space and images are 2-D so we need some wa of projecting 3-D to 2-D The fundamental approach: planar projection first, we define a plane in 3-D
More informationToday. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline
Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on
More informationWire-Frame 3D Graphics Accelerator IP Core. C Library Specification
Wire-Frame 3D Graphics Accelerator IP Core C Library Specification Kenji Ishimaru 1 / 29 Revision History Rev. Date Author Description 1.0 2015/09/30 Kenji Ishimaru First release
More informationComputer Graphics (CS 543) Lecture 6a: Viewing & Camera Control. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)
Computer Graphics (CS 543) Lecture 6a: Viewing & Camera Control Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) 3D Viewing? Specify a view volume Objects inside view volume
More informationFachhochschule Regensburg, Germany, February 15, 2017
s Operations Fachhochschule Regensburg, Germany, February 15, 2017 s Motivating Example s Operations To take a photograph of a scene: Set up your tripod and point camera at the scene (Viewing ) Position
More informationCS 112 The Rendering Pipeline. Slide 1
CS 112 The Rendering Pipeline Slide 1 Rendering Pipeline n Input 3D Object/Scene Representation n Output An image of the input object/scene n Stages (for POLYGON pipeline) n Model view Transformation n
More informationComputer Graphics. Lecture 11 Procedural Geometry. Edirlei Soares de Lima.
Computer Graphics Lecture 11 Procedural Geometry Edirlei Soares de Lima Procedural Content Generation Procedural content generation is the method of creating data
More information3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing
Chapter II Vertex Processing Rendering Pipeline Main stages in the pipeline The vertex processing stage operates on every input vertex stored in the vertex buffer and performs various operations such as
More informationViewing COMPSCI 464. Image Credits: Encarta and
Viewing COMPSCI 464 Image Credits: Encarta and http://www.sackville.ednet.ns.ca/art/grade/drawing/perspective4.html Graphics Pipeline Graphics hardware employs a sequence of coordinate systems The location
More informationCOMP Computer Graphics and Image Processing. 5: Viewing 1: The camera. In part 1 of our study of Viewing, we ll look at ˆʹ U ˆ ʹ F ˆʹ S
COMP27112 Û ˆF Ŝ Computer Graphics and Image Processing ˆʹ U ˆ ʹ F C E 5: iewing 1: The camera ˆʹ S Toby.Howard@manchester.ac.uk 1 Introduction In part 1 of our study of iewing, we ll look at iewing in
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coordinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationCS380: Computer Graphics Viewing Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:
CS38: Computer Graphics Viewing Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Know camera setup parameters Understand viewing and projection processes
More informationRasterization Overview
Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer
More informationTHE VIEWING TRANSFORMATION
ECS 178 Course Notes THE VIEWING TRANSFORMATION Kenneth I. Joy Institute for Data Analysis and Visualization Department of Computer Science University of California, Davis Overview One of the most important
More informationCMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker
CMSC427 Transformations II: Viewing Credit: some slides from Dr. Zwicker What next? GIVEN THE TOOLS OF The standard rigid and affine transformations Their representation with matrices and homogeneous coordinates
More informationRendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to mode
Graphic Pipeline 1 Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to model 3D world? How to render them?
More informationOne or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface
Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface Classical views are based
More informationCSC 470 Computer Graphics
CSC 47 Computer Graphics Three Dimensional Viewing Today s Lecture Three Dimensional Viewing Developing a Camera Fly through a scene Mathematics of Producing Stereo Views 1 2 Introduction We have already
More informationThe Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes
The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes What is it? The viewing pipeline is the procession of operations that are applied to the OpenGL matrices, in order to create a 2D representation
More informationCSC 470 Computer Graphics. Three Dimensional Viewing
CSC 470 Computer Graphics Three Dimensional Viewing 1 Today s Lecture Three Dimensional Viewing Developing a Camera Fly through a scene Mathematics of Projections Producing Stereo Views 2 Introduction
More information3D Viewing Episode 2
3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the
More informationCS464 Oct 3 rd Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline
CS464 Oct 3 rd 2017 Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline Assignment 3 Skeleton A good sequence to implement the program 1. Start with a flat terrain sitting at Y=0 and Cam at
More informationLecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009
Model s Lecture 3 Sections 2.2, 4.4 World s Eye s Clip s s s Window s Hampden-Sydney College Mon, Aug 31, 2009 Outline Model s World s Eye s Clip s s s Window s 1 2 3 Model s World s Eye s Clip s s s Window
More informationGraphics pipeline and transformations. Composition of transformations
Graphics pipeline and transformations Composition of transformations Order matters! ( rotation * translation translation * rotation) Composition of transformations = matrix multiplication: if T is a rotation
More informationCSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017
CSE 167: Introduction to Computer Graphics Lecture #5: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Friday: homework 1 due at 2pm Upload to TritonEd
More informationEECS : Introduction to Computer Graphics Building the Virtual Camera ver. 1.4
EECS 351-1 : Introduction to Computer Graphics Building the Virtual Camera ver. 1.4 3D Transforms (cont d): 3D Transformation Types: did we really describe ALL of them? No! --All fit in a 4x4 matrix, suggesting
More informationViewing. Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points
Viewing Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points Viewing Announcements. A Note About Transformations. Orthographic and Perspective
More informationFundamental Types of Viewing
Viewings Fundamental Types of Viewing Perspective views finite COP (center of projection) Parallel views COP at infinity DOP (direction of projection) perspective view parallel view Classical Viewing Specific
More informationDrawing in 3D (viewing, projection, and the rest of the pipeline)
Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Spring 2017 Lecture 6 February 2, 2017 The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get
More informationNotes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment
Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix
More informationViewing with Computers (OpenGL)
We can now return to three-dimension?', graphics from a computer perspective. Because viewing in computer graphics is based on the synthetic-camera model, we should be able to construct any of the classical
More informationCSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013
CSE 167: Introduction to Computer Graphics Lecture #3: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 1 due tomorrow (Friday), presentation
More informationCITSTUDENTS.IN VIEWING. Computer Graphics and Visualization. Classical and computer viewing. Viewing with a computer. Positioning of the camera
UNIT - 6 7 hrs VIEWING Classical and computer viewing Viewing with a computer Positioning of the camera Simple projections Projections in OpenGL Hiddensurface removal Interactive mesh displays Parallelprojection
More informationThree-Dimensional Viewing Hearn & Baker Chapter 7
Three-Dimensional Viewing Hearn & Baker Chapter 7 Overview 3D viewing involves some tasks that are not present in 2D viewing: Projection, Visibility checks, Lighting effects, etc. Overview First, set up
More informationPrinciples of Computer Game Design and Implementation. Lecture 6
Principles of Computer Game Design and Implementation Lecture 6 We already knew Game history game design information Game engine 2 What s Next Mathematical concepts (lecture 6-10) Collision detection and
More informationCamera Placement for Ray Tracing
Camera Placement for Ray Tracing Lecture #3 Tuesday 0/4/4 st Review Camera Placement! The following slides review last Thursday s Lecture on world to camera transforms.! To see shift to raytracing context,
More informationCSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016
CSE 167: Introduction to Computer Graphics Lecture #3: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Next Monday: homework discussion Next Friday:
More informationPipeline Operations. CS 4620 Lecture 14
Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives
More informationCOMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting
Ray Casting COMP 175: Computer Graphics April 26, 2018 1/41 Admin } Assignment 4 posted } Picking new partners today for rest of the assignments } Demo in the works } Mac demo may require a new dylib I
More informationProjection and viewing. Computer Graphics CSE 167 Lecture 4
Projection and viewing Computer Graphics CSE 167 Lecture 4 CSE 167: Computer Graphics Review: transformation from the object (or model) coordinate frame to the camera (or eye) coordinate frame Projection
More informationViewing and Projection
CSCI 480 Computer Graphics Lecture 5 Viewing and Projection January 25, 2012 Jernej Barbic University of Southern California Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective
More informationViewing Transformation
CS38: Computer Graphics Viewing Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Know camera setup parameters Understand viewing and projection processes
More informationClassical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico
Classical and Computer Viewing Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Planar Geometric Projections Standard projections project onto a plane Projectors
More informationBASIC ELEMENTS. Geometry is the study of the relationships among objects in an n-dimensional space
GEOMETRY 1 OBJECTIVES Introduce the elements of geometry Scalars Vectors Points Look at the mathematical operations among them Define basic primitives Line segments Polygons Look at some uses for these
More informationEECS : Introduction to Computer Graphics Building the Virtual Camera ver. 1.5
EECS 351-1 : Introduction to Computer Graphics Building the Virtual Camera ver. 1.5 3D Transforms (cont d): We havent yet explored ALL of the geometric transformations available within a 4x4 matrix. --All
More informationOverview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization
Overview Viewing and perspectives Classical views Computer viewing Perspective normalization Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface
More informationComputer Vision Projective Geometry and Calibration. Pinhole cameras
Computer Vision Projective Geometry and Calibration Professor Hager http://www.cs.jhu.edu/~hager Jason Corso http://www.cs.jhu.edu/~jcorso. Pinhole cameras Abstract camera model - box with a small hole
More informationCSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems
CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015 Announcements Project 2 due Friday at 1pm Homework
More information3D Viewing Episode 2
3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the
More informationChap 7, 2008 Spring Yeong Gil Shin
Three-Dimensional i Viewingi Chap 7, 28 Spring Yeong Gil Shin Viewing i Pipeline H d fi i d? How to define a window? How to project onto the window? Rendering "Create a picture (in a synthetic camera)
More informationCS354 Computer Graphics Viewing and Modeling
Slide Credit: Donald S. Fussell CS354 Computer Graphics Viewing and Modeling Qixing Huang February 21th 2018 Computer Viewing There are three aspects of the viewing process, all of which are implemented
More informationPerspective transformations
Perspective transformations Transformation pipeline Modelview: model (position objects) + view (position the camera) Projection: map viewing volume to a standard cube Perspective division: project D to
More informationComputer Science 426 Midterm 3/11/04, 1:30PM-2:50PM
NAME: Login name: Computer Science 46 Midterm 3//4, :3PM-:5PM This test is 5 questions, of equal weight. Do all of your work on these pages (use the back for scratch space), giving the answer in the space
More informationModels and The Viewing Pipeline. Jian Huang CS456
Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and
More informationComputing the 3D Viewing Transformation
Computing the 3D Viewing Transformation John E. Howland Department of Computer Science Trinity University 715 Stadium Drive San Antonio, Texas 78212-7200 Voice: (210) 999-7380 Fax: (210) 999-7477 E-mail:
More informationAnnouncements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard
Now Playing: Vertex Processing: Viewing Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005 Rick Skarbez, Instructor COMP 575 September 27, 2007 Announcements Programming Assignment
More informationShadows in the graphics pipeline
Shadows in the graphics pipeline Steve Marschner Cornell University CS 569 Spring 2008, 19 February There are a number of visual cues that help let the viewer know about the 3D relationships between objects
More informationLecture 4. Viewing, Projection and Viewport Transformations
Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu
More informationMidterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer
Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer The exam consists of 10 questions. There are 2 points per question for a total of 20 points. You
More informationSpecifying Complex Scenes
Transformations Specifying Complex Scenes (x,y,z) (r x,r y,r z ) 2 (,,) Specifying Complex Scenes Absolute position is not very natural Need a way to describe relative relationship: The lego is on top
More informationINTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52
cs337 It looks like a matrix Sort of Viewing III Projection in Practice / 52 cs337 Arbitrary 3D views Now that we have familiarity with terms we can say that these view volumes/frusta can be specified
More informationSUMMARY. CS380: Introduction to Computer Graphics Projection Chapter 10. Min H. Kim KAIST School of Computing 18/04/12. Smooth Interpolation
CS38: Introduction to Computer Graphics Projection Chapter Min H. Kim KAIST School of Computing Smooth Interpolation SUMMARY 2 Cubic Bezier Spline To evaluate the function c(t) at any value of t, we perform
More informationCSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 2 due Friday, October 11
More informationI N T R O D U C T I O N T O C O M P U T E R G R A P H I C S
3D Viewing: the Synthetic Camera Programmer s reference model for specifying 3D view projection parameters to the computer General synthetic camera (e.g., PHIGS Camera, Computer Graphics: Principles and
More informationPipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11
Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION
More informationGetting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.
Overview (1): Getting Started Setting up OpenGL/GLUT on Windows/Visual Studio COSC 4431/5331 Computer Graphics Thursday January 22, 2004 Overview Introduction Camera analogy Matrix operations and OpenGL
More information09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo
9 - Designing Surfaces Triangular surfaces A surface can be discretized by a collection of points and triangles Each triangle is a subset of a plane Every point on the surface can be expressed as an affine
More informationComputer Graphics. Basic 3D Programming. Contents
Computer Graphics Basic 3D Programming September 21, 2005 Sun-Jeong Kim 1 http://www.hallym.ac.kr/~sunkim/teach/2005/cga Contents Cameras and objects Perspective projections Orthographic projections Viewing
More information2D and 3D Viewing Basics
CS10101001 2D and 3D Viewing Basics Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Viewing Analog to the physical viewing
More information3D Geometry and Camera Calibration
3D Geometry and Camera Calibration 3D Coordinate Systems Right-handed vs. left-handed x x y z z y 2D Coordinate Systems 3D Geometry Basics y axis up vs. y axis down Origin at center vs. corner Will often
More informationCSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Project 2 due Friday, October 12
More information1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1
Transformations 1-1 Transformations are used within the entire viewing pipeline: Projection from world to view coordinate system View modifications: Panning Zooming Rotation 1-2 Transformations can also
More informationBasic Elements. Geometry is the study of the relationships among objects in an n-dimensional space
Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set
More informationDescribe the Orthographic and Perspective projections. How do we combine together transform matrices?
Aims and objectives By the end of the lecture you will be able to Work with multiple transform matrices Describe the viewing process in OpenGL Design and build a camera control APIs Describe the Orthographic
More information7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky
7. 3D Viewing Projection: why is projection necessary? 1 7. 3D Viewing Projection: why is projection necessary? Because the display surface is 2D 2 7.1 Projections Perspective projection 3 7.1 Projections
More information1 OpenGL - column vectors (column-major ordering)
OpenGL - column vectors (column-major ordering) OpenGL uses column vectors and matrices are written in a column-major order. As a result, matrices are concatenated in right-to-left order, with the first
More informationPipeline Operations. CS 4620 Lecture 10
Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination
More information3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller
3D Viewing Introduction to Computer Graphics Torsten Möller Machiraju/Zhang/Möller Reading Chapter 4 of Angel Chapter 13 of Hughes, van Dam, Chapter 7 of Shirley+Marschner Machiraju/Zhang/Möller 2 Objectives
More information