Drawing in 3D (viewing, projection, and the rest of the pipeline)

Similar documents
Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing Fast The Graphics Pipeline

3D Viewing. CS 4620 Lecture 8

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

Drawing Fast The Graphics Pipeline

Graphics Pipeline 2D Geometric Transformations

Lecture 4. Viewing, Projection and Viewport Transformations

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Drawing Fast The Graphics Pipeline

CS 4620 Program 3: Pipeline

CS464 Oct 3 rd Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Computer Graphics 7: Viewing in 3-D

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

Lecture 4: 3D viewing and projections

CS251 Spring 2014 Lecture 7

Shadows in the graphics pipeline

Overview. By end of the week:

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

CS451Real-time Rendering Pipeline

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Rasterization Overview

For each question, indicate whether the statement is true or false by circling T or F, respectively.

The Graphics Pipeline and OpenGL I: Transformations!

Viewing. Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points

Ray Tracing. CS 4620 Lecture 5

Game Architecture. 2/19/16: Rasterization

COMP30019 Graphics and Interaction Perspective Geometry

CS Exam 1 Review Problems Fall 2017

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Computer graphics 2: Graduate seminar in computational aesthetics

Scanline Rendering 1 1/42

2.1 Transforming Linear Functions

Computer Vision CS 776 Fall 2018

Culling. Computer Graphics CSE 167 Lecture 12

Projection and viewing. Computer Graphics CSE 167 Lecture 4

CSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

CS559 Computer Graphics Fall 2015

Transforms 3: Projection Christian Miller CS Fall 2011

Pipeline Operations. CS 4620 Lecture 10

CS 418: Interactive Computer Graphics. Projection

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

The Graphics Pipeline and OpenGL I: Transformations!

Prof. Feng Liu. Fall /19/2016

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

CMPSCI 670: Computer Vision! Image formation. University of Massachusetts, Amherst September 8, 2014 Instructor: Subhransu Maji

The Rasterization Pipeline

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Pipeline Operations. CS 4620 Lecture 14

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

CS 130 Exam I. Fall 2015

Temporal Resolution. Flicker fusion threshold The frequency at which an intermittent light stimulus appears to be completely steady to the observer

Advanced Texture-Mapping Curves and Curved Surfaces. Pre-Lecture Business. Texture Modes. Texture Modes. Review quiz

CS 432 Interactive Computer Graphics

CSE328 Fundamentals of Computer Graphics

Geometric camera models and calibration

CS 130 Final. Fall 2015

CS6670: Computer Vision

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Models and The Viewing Pipeline. Jian Huang CS456

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Movie: Geri s Game. Announcements. Ray Casting 2. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

Viewing with Computers (OpenGL)

Viewing. Part II (The Synthetic Camera) CS123 INTRODUCTION TO COMPUTER GRAPHICS. Andries van Dam 10/10/2017 1/31

Viewing Transformations I Comp 535

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Computer Graphics. Ch 6. 3D Viewing

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Computer Graphics: Viewing in 3-D. Course Website:

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Introduction to Computer Vision

CS452/552; EE465/505. Geometry Transformations

2D/3D Geometric Transformations and Scene Graphs

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

CS 354R: Computer Game Technology

3D GRAPHICS. design. animate. render

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

CS4670: Computer Vision

CS 4204 Computer Graphics

Intro to Ray-Tracing & Ray-Surface Acceleration

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Lecture 17: Shadows. Projects. Why Shadows? Shadows. Using the Shadow Map. Shadow Maps. Proposals due today. I will mail out comments

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Computer Graphics Shadow Algorithms

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

COMP3421. Introduction to 3D Graphics

Graphics pipeline and transformations. Composition of transformations

GEOMETRIC TRANSFORMATIONS AND VIEWING

Transcription:

Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Fall 2016 Lecture 6/7 September 26-28 2016

The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get from where you want to be to where you need to be. Hierarchical modeling lets us build things out of pieces. 2. Use homogeneous coordinates and transformations to make common operations easy. Translation, projections, coordinate system shift all become simple matrix multiplies. 3. Create viewing transformations with projection. The geometry of imaging (pinhole camera model) leads to linear transformations in homogeneous coordinates. 4. Implement primitive-based rendering (interactive graphics) with a pipeline. The abstractions map nicely onto hardware, and let you do things like visibility computations easily. Be aware that there are other paradigms for drawing.

The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get from where you want to be to where you need to be. Hierarchical modeling lets us build things out of pieces. Last 2 Weeks 2. Use homogeneous coordinates and transformations to make common operations easy. Translation, projections, coordinate system shift all become simple matrix multiplies. 3. Create viewing transformations with projection. The geometry of imaging (pinhole camera model) leads to linear transformations in homogeneous coordinates. This Week 4. Implement primitive-based rendering (interactive graphics) with a pipeline. The abstractions map (and nicely next) onto hardware, and let you do things like visibility computations easily. Be aware that there are other paradigms for drawing.

ReCap: Basic Idea To draw we need a coordinate system Transformations can Move between coordinate systems Move objects around Useful transformations as matrices

ReCap: Math Points, Vectors, Matrices Transformations as linear operators Matrices (homogeneous coordinates) 3D Coordinate Systems cross product, right hand rule

What about 3D?

How to draw in 3D? We are making a 2D picture! Do it Like nature does Like artists do

Do it like Da Vinci!

Primitive-based Rendering Draw 2D Objects in the image Paint strokes on canvas Lines / Triangles on screen Map (Transform) 3D primitives (world) to 2D primitives (screen)

What does it take to do this? 1. Put a 3D primitive in the World 2. Figure out what color it should be 3. Position relative to the Eye 4. Get rid of stuff behind you/offscreen 5. Figure out where it goes on screen 6. Figure out if something else blocks it 7. Draw the 2D primitive

In terms of the readings A lot of the pieces are there Not necessarily in any particular order Good for the details Today we ll try for the big picture

What does it take to do this? 1. Put a 3D primitive in the World 2. Figure out what color it should be 3. Position relative to the Eye 4. Get rid of stuff behind you/offscreen 5. Figure out where it goes on screen 6. Figure out if something else blocks it 7. Draw the 2D primitive

1. Put a 3D primitive in the World Modeling 2. Figure out what color it should be Shading 3. Position relative to the Eye Viewing / Camera Transformation 4. Get rid of stuff behind you/offscreen Clipping 5. Figure out where it goes on screen Projection (sometimes called Viewing) 6. Figure out if something else blocks it Visibility / Occlustion 7. Draw the 2D primitive Rasterization (convert to Pixels)

In case you re wondering (We ll come back to this. It s a detail) For the kinds of projection we will use 3D Points map to 2D Points 3D Lines map to 2D Lines 3D Triangles map to 2D Triangles Doesn t work for curves (even ellipses)

Viewing How to get from the object to the screen? A transformation between coord systems A little weird

3D to 2D Do we lose a dimension? No we actually need to keep it Yes but we ll just ignore Z The screen as a fishtank

From object to eye: ModelView Modeling matrix: object to world Viewing matrix: world to eye / camera Rigid Transformation (rotate/translate) Invert the camera s model matrix Build a LookAt / LookFrom matrix

Next Problem: Projection Convert 3D (eye coordinates) to 2D (screen) A transformation Types: Orthographic Perspective some others we won t talk much about

Orthographic Projection Scale X and Y to fit things on screen Note: we can look in any direction we are already in camera coodinates!

Orthographic Projections Simple Preserves Distances Objects far away same size as close Looks weird

Perspective Projections Objects that are far away look smaller

Drawing in Perspective

A draughtsman drawing a portrait, Albrecht Dürer, 1532. E.44-1894 hip://www.vam.ac.uk/content/armcles/d/drawing- techniques/

hip://hans.wyrdweb.eu/about- perspecmve/

Perspective Imaging Eye Point a.k.a. Focal Point Image Plane

Perspective Assumptions There is a single focal point Simplifying Assumptions: (not required) Image plane orthogonal to view direction Image plane centered on view direction

Image plane in front of eye Image plane behind eye d d d is the focal length

Pinhole Camera d