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

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

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

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Computer Graphics. P05 Viewing in 3D. Part 1. Aleksandra Pizurica Ghent University

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

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

CITSTUDENTS.IN VIEWING. Computer Graphics and Visualization. Classical and computer viewing. Viewing with a computer. Positioning of the camera

Introduction to Computer Graphics 4. Viewing in 3D

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Chapter 5. Projections and Rendering

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

Viewing with Computers (OpenGL)

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

3D Viewing. With acknowledge to: Ed Angel. Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Overview of Projections: From a 3D world to a 2D screen.

Rasterization Overview

CS452/552; EE465/505. Models & Viewing

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

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Three-Dimensional Viewing Hearn & Baker Chapter 7

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

COMP Computer Graphics and Image Processing. a6: Projections. In part 2 of our study of Viewing, we ll look at. COMP27112 Toby Howard

2D and 3D Viewing Basics

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

Chapter 8 Three-Dimensional Viewing Operations

Lecture 4. Viewing, Projection and Viewport Transformations

Computer Graphics 7: Viewing in 3-D

Fundamental Types of Viewing

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Overview. By end of the week:

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

CSE328 Fundamentals of Computer Graphics

I 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

Viewing/Projections IV. Week 4, Fri Feb 1

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

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

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

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

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Game Architecture. 2/19/16: Rasterization

Announcement. Project 1 has been posted online and in dropbox. Due: 11:59:59 pm, Friday, October 14

Viewing. Reading: Angel Ch.5

Shadows in the graphics pipeline

Lecture 4: Viewing. Topics:

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

CS451Real-time Rendering Pipeline

The Graphics Pipeline and OpenGL I: Transformations!

3D Viewing. CS 4620 Lecture 8

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Viewing and Projection Transformations

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

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

Geometry: Outline. Projections. Orthographic Perspective

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

OpenGL Transformations

CHAPTER 1 Graphics Systems and Models 3

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

Chap 7, 2008 Spring Yeong Gil Shin

COMP30019 Graphics and Interaction Perspective Geometry

Building Models. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Computer graphics 2: Graduate seminar in computational aesthetics

CS 4204 Computer Graphics

Viewing Transformation

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

RASTERISED RENDERING

1 OpenGL - column vectors (column-major ordering)

Chapter 5-3D Camera & Optimizations, Rasterization

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

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

Chapter 4-3D Camera & Optimizations, Rasterization

Models and Architectures

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

The Graphics Pipeline and OpenGL I: Transformations!

Scene Modeling for a Single View

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

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

Three Main Themes of Computer Graphics

CSC 470 Computer Graphics. Three Dimensional Viewing

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Pipeline Operations. CS 4620 Lecture 14

Projection and viewing. Computer Graphics CSE 167 Lecture 4

MAE : Lecture #12 - Projection and Perspective. Lecture Overview:

Advanced Computer Graphics (CS & SE )

Computer Graphics. Ch 6. 3D Viewing

CS 4620 Program 3: Pipeline

CS 418: Interactive Computer Graphics. Projection

CS 130 Final. Fall 2015

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

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

So we have been talking about 3D viewing, the transformations pertaining to 3D viewing. Today we will continue on it. (Refer Slide Time: 1:15)

3D computer graphics: geometric modeling of objects in the computer and rendering them

CS 112 The Rendering Pipeline. Slide 1

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

Projection Lecture Series

3D Viewing Episode 2

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.

Transcription:

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 1 is due TONIGHT at 11:59pm If you want to demo your program in person, I d like to do it Friday afternoon if possible Please contact me by email (TODAY) to set up a time Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard blackboard.unc.edu Include a document that lists What optional components you did Instructions for use Any problems that you had, or components that do not work properly Please submit as a zip file with your name in the filename Last Time Today Presented the functions needed for lighting and shading in OpenGL Demoed some lighting and shading functions in OpenGL Briefly discussed Non-Photorealistic Rendering (NPR) Review the OpenGL pipeline Discuss viewing and how it applies to computer graphics 1

Geometry (Vertices) Rendering Pipeline OpenGL rendering works like an assembly line Each stage of the pipeline performs a distinct function on the data flowing by Each stage is applied to every vertex to determine its contribution to output pixels Vertex Processing Rasterizer Fragment Processing Pixels Vertex Processing The job of the vertex processing step is to take arbitrary input geometry, and turn it into something that the rasterizer can understand Input: arbitrary geometry, lighting and camera information Output: Shaded screen-space polygons Vertex Processing Vertex processing consists of: ModelView transform Projection transform Lighting divide Polygon clipping Viewport transform Vertex Processing Vertex Processing Vertex Processing Projection Transform Viewport Transform Vertices Modelview Transform Lighting Clipping & Primitive Assembly Vertex Processing We already talked about lighting We already talked about modeling transformations We talked a bit about projections and viewports We re going to do that in more detail today Clipping is for next time Viewing in OpenGL The OpenGL viewpoint acts as a virtual camera What parameters do you need to define a camera? Viewpoint (Center of Projection) View direction Field of view Film size Projection plane 2

Viewing Viewing requires 3 elements: Objects to be viewed A viewer with a projection surface A projection from the objects to the viewing surface Viewing Example: A real camera Objects: Whatever you re taking a picture of: landscape, people, etc. Viewer: The camera (with its film as the projection surface) Projection: Defined by the lens, maps 3D objects on to the 2D surface Viewing Example: OpenGL camera Objects: The input geometry Viewer: The OpenGL camera (with the view volume as its viewing surface ) Projection: The OpenGL projection matrix (GL_PROJECTION), maps 3D space (world coordinates) into 3D space (eye coordinates) Eventually into normalized device coordinates (NDC) Classical Viewing Classical views are based on the relationship between these 3 elements: objects, a viewer, and a projection In classical views, objects are assumed to be constructed from flat principal faces i.e. many buildings Used primarily by architects / engineers Planar Geometric Standard projections are assumed to be onto a single plane A projection can be perspective or orthographic In perspective projection, all rays converge at a single point (the center of projection, or COP) In orthographic projection, all rays are parallel vs. Parallel Viewing volume is a truncated pyramid aka frustum Orthographic Viewing volume is a box Orthographic 3

Taxonomy of Planar Geometric Planar Geometric Parallel / Orthographic Multiview Axonometric Oblique Multiview Orthographic Projection plane parallel to principle face Multiview simply means generating an orthographic view for multiple faces Commonly seen in 3D modeling programs Isometric Top View Isometric Dimetric Trimetric One-point Two-point Three-point Side View Front View Benefits Why use orthographic? Preserves distances and angles does not Can be used for measurements Why multiview? The main problem with orthographic projection is that it hides many surfaces Often add isometric view as well Axonometric Direction of projection is still perpendicular to the viewing plane But principle faces not parallel to it 3 different kinds: Isometric, dimetric, trimetric Classified by number of different foreshortening factors Axonometric Typically, one axis of space is drawn as the vertical (as seen here) Advantages and Advantages: Disadvantages Can see multiple faces of an object simultaneously Lines are scaled, but by a constant factor Could still be used for measurement Disadvantages: Angles not preserved Foreshortening does not depend on distance Not realistic 4

Oblique Projection Direction of projection is not perpendicular to the viewing plane Most general parallel projection Is this possible with a normal camera? Orthogonal So what is the matrix for an orthogonal projection? Assume we re looking down z How would you implement an axonometric projection? Orthogonal Projection + Rotation(s) How would you implement an oblique projection? Orthogonal Projection + Rotation(s) + Shear(s) Orthographic Examples How would you map an arbitrary bounding volume (nearxyz, farxyz) into the volume defined by (-1, -1, -1) and (1, 1, 1)? Vanishing Points In perspective projection, parallel lines (parallel in the scene) appear to converge to a single point This is called the vanishing point projections are distinguished by the number of vanishing points in the image One, two, or three One-point One principal face is parallel to the projection plane 5

Two-point One principal direction (i.e. axis) is parallel to the projection plane Three-point Nothing parallel to the projection plane Usually used when looking up at or down on buildings Classical Viewing Recap Classical viewing is not accurate Can be useful for various reasons Two main branches Parallel projection projection Movie Break! The Aeronaut Nicholas Lombardo Ringling School of Art & Design SIGGRAPH 2006 Available online: http://www.bestfilmoncampus.com/filmmaker/default.aspx?filmma kerid=269&filmid=628 Doing in OpenGL We already know the commands to set up projection matrices: glortho(...) gluortho2d(...) gl(...) glufrustum(...) Now we ll talk a bit about what they really mean Positioning the Camera We usually assume that the camera is located at (0,0,0), looking down -z What do we do if we want it to appear somewhere else? Translate the world by the opposite of the new location Two ways to think about this: Whole object moves into the camera frame Camera moves (need to apply transforms in reverse order) 6

Projection Divide divide is the mechanism by which objects farther away are made to appear smaller How? Divide x = (x * d) / z y = (y * d) / z How would you implement this in a matrix? [1 0 0 0] [0 1 0 0] [0 0 1 0] [0 0 1/d 0] d is the z location of the projection plane How does this work? Divide M * [x y z 1] T = [x y z (z/d)] T Need to normalize new point: normalize([x y z (z/d)] T ) = [(xd/z) (yd/z) d 1] This is the image of that point on the projection plane What happens if d = 0? Viewport Transform After perspective divide, we know where the vertices will map to in 2D But in normalized device coordinates Need to know where these will actually be displayed This is the viewport transform Viewport Transform Just need to translate into a different set of 2D coordinates From the rectangle defined by (-1, -1) and (1, 1) to the rectangle defined by (0, 0) and (width, height) How? Translate and scale What if the aspect ratio of the viewport is different from that of the camera? 7

Next Time Continuing with vertex processing Clipping Discussion of vertex shaders Assignment 2 will go out Reminder: Programming assignment 1 due TONIGHT by 11:59pm Upload to blackboard.unc.edu 8