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.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Today Composing transformations 3D Transformations
Three Dimensional Viewing
CS 352: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Transformations and Projections (Some slides adapted from Amitabh Varshney)
Cameras, lenses, and calibration
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
10/13/200© NTUST Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 2, 3 due Oct 13 in class.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
Viewing and Projections
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Week 2 - Wednesday CS361.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
2/24/04© University of Wisconsin, CS559 Spring 2004 Last Time 3D Transformations –Most are natural extensions of 2D transforms –Rotations can be represented.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
10/7/04© University of Wisconsin, CS559 Fall 2004 Last Time Transformations Homogeneous coordinates Directions Rotation Geometry 101 – Points, edges, triangles/polygons.
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.
Mark Nelson 3d projections Fall 2013
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Chapter 1 Graphics Systems and Models Models and Architectures.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Viewing Viewing and viewing space (camera space)
Rendering Pipeline Fall, 2015.
- Introduction - Graphics Pipeline
University of North Carolina at Greensboro
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
Camera Position (5.6) we specify the position and orientation of the camera to determine what will be seen. use gluLookAt (eye x, y, z, at x, y, z, up.
Computer Graphics CC416 Week 15 3D Graphics.
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
3D Transformations Source & Courtesy: University of Wisconsin,
CSC461: Lecture 20 Parallel Projections in OpenGL
CENG 477 Introduction to Computer Graphics
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
CSC461: Lecture 19 Computer Viewing
Models and Architectures
Models and Architectures
Models and Architectures
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Announcements Midterm out today Project 1 demos.
Chapter V Vertex Processing
Last Time Canonical view pipeline Projection Local Coordinate Space
Models and Architectures
Chap 3 Viewing Pipeline Reading:
Models and Architectures
Viewing (Projections)
THREE-DIMENSIONAL VIEWING II
THREE-DIMENSIONAL VIEWING
CS 352: Computer Graphics Chapter 5: Viewing.
Presentation transcript:

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 by line segments Any face can be triangulated (broken into triangles)

Modeling and OpenGL In OpenGL, all geometry is specified by stating which type of object and then giving the vertices that define it glBegin(…) …glEnd() glVertex[34][fdv] Three or four components (regular or homogeneous) Float, double or vector (eg float[3]) Chapter 2 of the red book

Rendering Determine where each object should go in the image Determine which object is in front at each pixel Determine what color it is

Graphics Pipeline Watt Ch 5 and 6 Graphics hardware employs a sequence of coordinate systems The movement of geometry through these spaces is considered a pipeline Local Coordinate Space World Coordinate Space View Space 3D Screen Space Display Space

Local Coordinate Space It is easiest to define individual objects in a local coordinate system For instance, a cube is easiest to define with faces parallel to the coordinate axis Key idea: Object instantiation Define an object in a local coordinate system Use it multiple times by copying it and transforming it into the global system

Global Coordinate System All the objects in the world are transformed into one coordinate system - the global coordinate system Lighting is defined in this space The camera is defined with respect to this space Some higher level operations, such as advanced visibility computations, can be done here

View Space Associate a set of axes with the image plane One normal to the image plane One up in the image plane One right in the image plane Some camera parameters are easiest to define in this space Focal length, image size

3D Screen Space Transform view space into a cube Task to do: Parallel sides make things easier Task to do: Rasterization - decide which pixels are covered Hidden surface removal - decide what is in front Shading - decide what color things are

Display Space Convert the virtual screen into real screen coordinates Drop the depth coordinates and translate The windowing system takes care of this

OpenGL and Transformations OpenGL combines all the transformations up to view space into the MODELVIEW matrix View space to Screen Space is done with the PROJECTION matrix Matrix calls multiple some matrix M onto the current matrix C: CM Set view transformation first, then set transformations from local to world space

Defining View Space View space is defined by location of three mutually perpendicular axes in world space Translation, rotation and scaling can take points in world space to points in view space Typically defined by: Center of the image plane in world space: View Reference Point (VRP) The normal to the image plane: View Plane Normal (VPN) A vector in world space that should be “up” in view space (VUP)

direction in the film plane. vector v is projection of z View reference point and view plane normal specify film plane. Up vector gives an “up” direction in the film plane. vector v is projection of up vector into film plane = (n x vup) x n u is chosen so that (u, v, n) is a right handed coordinate system; i.e. it is possible to rotate (x->u, y->v, z->n) (and we’ll do this shortly). VRP, VPN, VUP must be in world coords W o r l d c o o r d i n a t e s x y U p v e c t o r V i e w r e f e r e n c e u p o i n t v n V i e w p l a n e n o r m a l

World to View Space Translate by subtracting VRP Rotate by amount that aligns camera axes with world axes: All done for you in OpenGL: gluLookAt takes the VRP, a point along the VPN, and VUP Multiplies the required transformation onto the current transformation (normally the identity)

Default OpenGL Camera The default OpenGL image plane has u aligned with the x axis, v aligned with y, and n aligned with z Means the default camera looks along the negative z axis Makes it easy to do 2D drawing (no need for any view transformation)

Left vs Right Handed View Space You can define u as right, v as up, and n as toward the viewer: a right handed system uv=n Advantage: Standard mathematical way of doing things You can also define u as right, v as up and n as into the scene: a left handed system vu=n Advantage: Bigger n values mean points are further away OpenGL is right handed

Projection The conversion from view space to screen space is called projection Two general classes: Orthographic, or parallel, projection Perspective projection

Orthographic Projection Points project along rays perpendicular to the image plane Just drop the n coordinate, and maybe scale and translate OpenGL: glOrtho(…) Sets the appropriate projection matrix

Orthographic projection

Perspective Projection Abstract camera model - box with a small hole in it Pinhole cameras work in practice - camera obscura, etc

Distant Objects Are Smaller

Parallel lines meet common to draw film plane in front of the focal point

Vanishing points Each set of parallel lines (=direction) meets at a different point: The vanishing point for this direction Sets of parallel lines on the same plane lead to collinear vanishing points: the horizon for that plane Easy examples corridor higher = further away Good way to spot faked images