Mark Nelson 3d projections Fall 2013

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Graphics Pipeline.
Three Dimensional Modeling Transformations
Mark Nelson Rendering algorithms Fall 2013
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
Lecture 4: 3D Rendering Pipeline (I) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
HCI 530 : Seminar (HCI) Damian Schofield.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
Lecture 3 – Transformation And Coordinate Systems
Cameras, lenses, and calibration
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
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.
Computer Graphics (fall 2009)
CSE 381 – Advanced Game Programming Basic 3D Graphics
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The Geometry Pipeline.
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.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
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.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization 3D Rendering Praktikum: Shader Gallery The.
Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Computer Graphics Camera Projection / Picking CO2409 Week 8 - Optional Advanced Material Not on Exam.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
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.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Viewpoints and Transformations CSIS 5838: Graphics and Animation for Gaming.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
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.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Applications and Rendering pipeline
Introduction to Computer Graphics
- Introduction - Graphics Pipeline
Computer Graphics CC416 Week 15 3D Graphics.
Intro to 3D Graphics.
Graphics Fundamentals
CSCE 441 Computer Graphics 3-D Viewing
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.
Graphics Processing Unit
CENG 477 Introduction to Computer Graphics
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Software Rasterization
Graphics Processing Unit
Chapter V Vertex Processing
UMBC Graphics for Games
Chapter VII Rasterizer
Presentation transcript:

Mark Nelson 3d projections Fall

The 3d pipeline (expansive view)  Tools stage  Asset conditioning stage  Application stage  | Geometry processing stage  | Rasterization stage

Tools stage  3d modeling  Export meshes (possibly w/ metadata)  Create textures

Asset conditioning stage  Platform- or engine-specific format conversations  Dependency resolution  ”Baked-in” effects  E.g., static lighting

Application stage  Run-time management in the engine  Prepare a scene  Combine e.g. Movable objects into one scene description  Omit anything that can’t possibly be visible  Set GPU rendering parameters

Basic GPU pipeline  Receive triangles  Triples of (x,y,z) vertices  Compute transformations  Rasterize  Turn into (x,y) screen pixels

World space  One 3d coordinate axis with all objects in a scene  Pre-culled by the engine to omit things that can’t possibly be visible  Constitutes the world geometry  E.g., can compute distances, collisions, etc.

Model space  We could have only world space  But, we often model objects externally (e.g. in 3dsmax)  Model space is the local coordinate space of one model, independent of a scene  Typically:  centered at (0,0,0)  aligned to an axis

Model to world space  To build a scene, all models have to be converted from local to world coordinates  Place in scene, then translate, rotate, and/or scale  Can be done ahead of time or on the GPU

Scene graph  Hierarchical data structure  Represents how to build a scene out of models  Root is world space  A transformation applies to anything below it in the tree  Can enable other optimizations

Scene graph

Camera  Engine and scene graph build up a scene description  In world space, from models in model space  We the viewer are somewhere in this world  At a coordinate (x,y,z)  Facing along a particular direction vector (x’,y’,z’)  What it looks like to us is view space

View space  In view space, we are:  at (0,0,0)  perpendicular to the (x,y) plane  facing along the z axis  Need to translate and rotate the world-space coordinates  3d version of rotating a map so up is where we’re facing

Projection  Project the (still 3d) view space onto our 2d screen  Orthographic projection  Just ignore z coordinate: (x,y,z)  (x,y) for all points  Perspective projection  Further away objects look smaller

Frustum

Perspective options  #1: First turn 3d view space into 3d perspective space  Make further away stuff smaller  Then later do an orthographic projection  Or, #2: Project directly  Impacts how things like frustum culling work

Simple perspective projection  If viewable depths are from z=1 to z=infinity:  x’ = x/z  y’ = y/z  2d screen centered at (0,0)

Wireframe projection  For each triangle  Project each vertex to 2d  Draw lines connecting them in 2d

Wireframe projection

Summary  Model space to world space  World space to view space  Projection  Missing: occlusion, lighting, shading

Transformation matrices  2d rotation  As matrix:

Transformation matrices  3d rotation is analogous  Can also do: scaling, shearing  However, translation can’t be directly done as a matrix  x’ = x + x_offset  y’ = y + y_offset  No matrix-multiply equivalent

Homogeneous coordinates  Extend 3d points and vectors to a 4d space  Stand-in dimension w=1  Now can define a translation transform as well  So all basic transforms can be chained  Get back to 3d by dividing x/y/z by w

Translation in matrix form

Affine transformations  Can represent all the relevant transformations with homogeneous coordinate 4x4 transform matrices  Translation, rotation, scaling, perspective transform  Common way of representing any transformation in APIs  Advanced alternative: quaternions

Project 2: a DIY renderer  Wireframe renderer  Due 22 October  Input: 3d coordinates, view position, view direction  Project to 2d coordinates, and draw (to screen or image)  Tuesday: more on perspective, and surfaces