What does OpenGL do?

Similar documents
Chap 7, 2009 Spring Yeong Gil Shin

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Chap 7, 2008 Spring Yeong Gil Shin

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

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

Transforms II. Overview. Homogeneous Coordinates 3-D Transforms Viewing Projections. Homogeneous Coordinates. x y z w

CS Computer Graphics: Transformations & The Synthetic Camera

Realtime 3D Computer Graphics & Virtual Reality. Viewing

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

5.8.3 Oblique Projections

Viewing and Projection

Lecture 4: Viewing. Topics:

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

Chapter 8 Three-Dimensional Viewing Operations

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

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

3-Dimensional Viewing

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu

3D Coordinates & Transformations

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

3D Geometry and Camera Calibration

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

CS559: Computer Graphics

CS488. Implementation of projections. Luc RENAMBOT

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

The 3-D Graphics Rendering Pipeline

CS 325 Computer Graphics

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Modeling Transformations

Viewing. Cliff Lindsay, Ph.D. WPI

Transformations II. Week 2, Wed Jan 17

CS 351: Perspective Viewing

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

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

CS 475 / CS 675 Computer Graphics. Lecture 7 : The Modeling-Viewing Pipeline

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

CSC 305 The Graphics Pipeline-1

3D Viewing and Projec5on. Taking Pictures with a Real Camera. Steps: Graphics does the same thing for rendering an image for 3D geometric objects

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

What and Why Transformations?

Two Dimensional Viewing

CS F-07 Objects in 2D 1

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

CPSC 314, Midterm Exam 1. 9 Feb 2007

Modeling Transformations

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Homogeneous Coordinates

4. Two Dimensional Transformations

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1

Computer Graphics 7: Viewing in 3-D

2D Transformations. 7 February 2017 Week 5-2D Transformations 1

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

Computer Viewing Computer Graphics I, Fall 2008

More on Transformations. COS 426, Spring 2019 Princeton University

Models and The Viewing Pipeline. Jian Huang CS456

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

CS4670: Computer Vision

High Dimensional Rendering in OpenGL

6. Modelview Transformations

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

CS770/870 Spring 2017 Transformations

Computer Graphics. Si Lu. Fall er_graphics.htm 10/11/2017

Note 2: Transformation (modeling and viewing)

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

Viewing/Projections III. Week 4, Wed Jan 31

CSE528 Computer Graphics: Theory, Algorithms, and Applications

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection

CSE452 Computer Graphics

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7

Introduction to Computer Graphics 4. Viewing in 3D

Viewing with Computers (OpenGL)

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

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

p =(x,y,d) y (0,0) d z Projection plane, z=d

Announcements. Tutorial this week Life of the polygon A1 theory questions

Transformations. Examples of transformations: shear. scaling

Graphics Pipeline 2D Geometric Transformations

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

3D Viewing Transformations

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Examples. Clipping. The Rendering Pipeline. View Frustum. Normalization. How it is done. Types of operations. Removing what is not seen on the screen

CSE328 Fundamentals of Computer Graphics

Modeling Transformations Revisited

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions?

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

Viewing/Projection IV. Week 4, Fri Jan 29

Geometric Model of Camera

Perspective Projection Transformation

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

Viewing in 3D (Chapt. 6 in FVD, Chapt. 12 in Hearn & Baker)

CS251 Spring 2014 Lecture 7

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

Geometry of image formation

3D Sensing. Translation and Scaling in 3D. Rotation about Arbitrary Axis. Rotation in 3D is about an axis

Transcription:

Theor behind Geometrical Transform

What does OpenGL do? So the user specifies a lot of information Ee Center Up Near, far, UP EE Left, right top, bottom, etc. f b CENTER left right top bottom

What does OpenGL do? What does a sstem programmer do with those numbers? Generate screen coordinates correctl and efficientl Inside/outside test Projection Here comes the part which contains math which ou ma not like But all ou need to know is matri operation

Arbitrar View Volume UP f b EE CENTER left right top bottom

Inside-Outside Test Intersection of A plane and A Line ) ( : t d c b a plane EE line of points end : ),, ( ),,, ( ) ( ) ( ) ( )] ( [ )] ( [ )] ( [ ) ( ) ( ) ( : t c b a d c b a t d t c t b t a t t t line

Clipping in Canonical Volumes 45^o - (A,B,C) - min near plane (A,B,C) - far planefilm -

Clipping with 6-bit outcode Perspective Above >- Below < Right >- Left < Behind <- In front >min Parallel Above > Below <- Right > Left <- Behind <- In front >

Projection Again, an intersection of A plane and A Line EE

Canonical Volumes - near plane (A/C,B/C) (A,B,C) (A,B) (A,B,C) 45^o min - - far planefilm -

Problem Both clipping and projection can be done efficientl in a canonical volume But we do not have a canonical volume in general Solution: Normaliation transform A single matri operation to bring objects in an arbitrar volume into a canonical volume Cannot change what the user sees

Case Stud:Normaliation Transform A transformation to facilitate clipping An arbitrar view volume: Epensive for clipping and projection

45 o The canonical view volume: Simple clipping (si-bit outcode) Simple projection (/, /) min

OpenGL Terminolog UP f b EE CENTER left right top bottom

PRP PHIGS Terminolog VUP f b VPN u min u ma v ma VRP v min

SideBar: Homogeneous Coordinates Inconsistent representation for translation Cannot be concatenated Homogeneous coordinates consistent representation for all three can be concatenated & pre-computed (,, ) ( w, w, w) ( w, w, w, w), w ( w/ w, w/ w, w/ w)

SideBar: Euler Angle Rotation ' ' ' cos sin sin cos θ θ θ θ ' ' ' cos sin sin cos θ θ θ θ sin cos cos sin ' ' ' θ θ θ θ

Sidebar: Rotation Matri An orthonormal matri Have orthogonal rows Have orthogonal columns Does not magnif or shrink sie of vector (eigen value is )

SideBar: Rotation From world to ee: Column vectors are the (,,), (,,), (,,) of the world frame in the ee frame From ee to world: Row vectors are the,, of the ee frame in world ee world ee camera world P R P R Row vectors are the,, of the ee frame in the world frame ' ' ' i j i j r r r R r r r R

SideBar: Rotation From world to ee j i r r r i i i r r r P r r r P ) ( (,,) world ee world ee camera world P R P R From ee to world ),, ( ) ( ' ' ' ' ' ' i j i i i r r r P r r r P r r r (,,) (,,) (,,) ' r ' r ' r

Comparison PHIGS PRP (projection reference point) VUP (viewup) VPN (view plane normal) VRP (view reference point) uma, umin, vma,vmin View plane F: front clipping distance B: back clipping distance OpenGL EE UP EE-CENTER (left, bottom, -near) right, left, top, bottom N/A (or back clipping) F B

Normaliation Transform Perspective - OpenGL Eternal parameters Translate EE into origin Rotate the EE coordinate sstem such that w (e-c) becomes u becomes v becomes Internal parameters Shear to have centerline of the view volume aligning with Scale into canonical truncated pramid

Eisting Rendering Pipeline graphics primitives modeling transform viewing transform clipping shading & teture transform Ee, lookat, Parallel or material, matri headup Perspective lights, volume surface color images on screen viewport transform images in Internal buffer projection viewport location

Rendering Pipeline with Normaliation Transform normaliation transform graphics primitives modeling transform viewing transform clipping shading & teture transform matri Ee, lookat, headup Parallel or Perspective volume material, lights, surface color images on screen viewport transform images in Internal buffer projection viewport location

Changes Modeling Viewing Normaliation get concatenated into ONE transform before appling to an primitives Confusion: normaliation does not just push the ee frame back to origin and line up with world frame, it pushes objects awa too Purpose: to make clipping and projection much more efficient

Viewing Normaliation Line up (--) and (U-V-W) Initiall, (U-V-W) are specified in (--) sstem (In fact, everthing is specified in -- sstem) Some point in time, want to specif things in (U-V-W) sstem, or U becomes (,,), V becomes (,,), W becomes (,,) Translation (eas) Rotation (hard)

Translate EE into the origin u v w u v w EE EE EE T

Viewing Normaliation Three rotations Rotate about Rotate about Rotate about

UP E-C rotation rotation rotation

Viewing Normaliation Figuring out [u, v, w] in [,, ] sstem Appling a rotation to transform [,, ] coordinates into [u, v, w] coordinates w e c e c u u p w u p w v w u u v w u u u v v v w w w

Rotate EE coordinate to align w. world sstem v u v w w u

Shear v v ),, ( near bottom top right left ),, ( near w u w u near bottom top b near right left a b a SH,, w

Scale into canonical volume top bottom - near far - 45 o - scale in and scale in top bottom near near S (, right left top bottom S (,, ) far far far,)

Eample EE (,,) CENTER (,,) UP (,,) ( right, left) (,) ( top, (,) ) F B bottom

Translate EE into the origin T Rotate EE to align with the world sstem 3 (,,) c e c e w R 6 6 6 3 3 3 ),, ( 6 ) (,, (,,) 6 ) (,, (,,) (,,) (,,) (,,) 3 u w v w UP w UP u c e

Shear, SH, near bottom top b near right left a

Scale into canonical volume scale in and S scale in S

Normaliation Transform Parallel (othographic) - OpenGL Eternal parameters Translate EE into origin Even though ee is not reall where the viewer is Rotate the EE coordinate sstem such that w (e-c) becomes u becomes v becomes Internal parameters Translate to have centerline of the view volume aligning with, and near plane at Scale into canonical rectangular piped

Viewing Normaliation Line up (--) and (U-V-W) Initiall, (U-V-W) are specified in (--) sstem (In fact, everthing is specified in -- sstem) Some point in time, want to specif things in (U-V-W) sstem, or U becomes (,,), V becomes (,,), W becomes (,,) Translation (eas) Rotation (hard)

Translate EE into the origin u v w u v w EE EE EE T

Viewing Normaliation Three rotations Rotate about Rotate about Rotate about

UP E-C rotation rotation rotation

Viewing Normaliation Figuring out [u, v, w] in [,, ] sstem Appling a rotation to transform [,, ] coordinates into [u, v, w] coordinates w e c e c u u p w u p w v w u u v w u u u v v v w w w

Rotate EE coordinate to align w. world sstem v u v w w u

Translation v v ),, ( near bottom top right left (,,) w u w u near c bottom top b right left a c b a T,,, w

Scale into canonical volume top bottom near Far-near near - - - top bottom scale in,, and S ( right left, top bottom, far ) near

Eample EE (,,) CENTER (,,) UP (,,) ( right, left) (,) ( top, (,) ) F B bottom

Translate EE into the origin T Rotate EE to align with the world sstem 3 (,,) c e c e w R 6 6 6 3 3 3 ),, ( 6 ) (,, (,,) 6 ) (,, (,,) (,,) (,,) (,,) 3 u w v w UP w UP u c e

Translation, SH, near bottom top b near right left a

Scale into canonical volume scale in,, and S 9