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

Similar documents
Computer Viewing Computer Graphics I, Fall 2008

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

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

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

2D and 3D Viewing Basics

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

Introduction to Computer Graphics 4. Viewing in 3D

Introduction to Computer Graphics with WebGL

CS354 Computer Graphics Viewing and Modeling

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

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

Fundamental Types of Viewing

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

Computer Viewing. CITS3003 Graphics & Animation. E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley

Computer Viewing and Projection. Overview. Computer Viewing. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

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

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

CS452/552; EE465/505. Models & Viewing

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

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

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

CSC 470 Computer Graphics. Three Dimensional Viewing

Geometry: Outline. Projections. Orthographic Perspective

Viewing with Computers (OpenGL)

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

CSC 470 Computer Graphics

Computer Graphics. Chapter 10 Three-Dimensional Viewing

CS 4204 Computer Graphics

Viewing and Projection

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

Chapter 8 Three-Dimensional Viewing Operations

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

3.1 Viewing and Projection

7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky

Viewing and Modeling

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

Viewing and Projection

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

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Advanced Computer Graphics (CS & SE )

Viewing and Projection

Chapter 5. Projections and Rendering

COMP3421. Introduction to 3D Graphics

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

COMP3421. Introduction to 3D Graphics

Computer Graphics. Ch 6. 3D Viewing

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

Introduction to Computer Graphics with WebGL

CS380: Computer Graphics Viewing Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

Lecture 4: Viewing. Topics:

Fachhochschule Regensburg, Germany, February 15, 2017

COMS 4160: Problems on Transformations and OpenGL

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

Viewing Transformation

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

Course no. DIS4566 National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

Transformations. Rotation and Scaling

Order of Transformations

COMP Computer Graphics and Image Processing. 5: Viewing 1: The camera. In part 1 of our study of Viewing, we ll look at ˆʹ U ˆ ʹ F ˆʹ S

OpenGL Transformations

Computer Graphics. Basic 3D Programming. Contents

COMP3421. Introduction to 3D Graphics

5.8.3 Oblique Projections

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

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

Chapter 5-3D Camera & Optimizations, Rasterization

CS 418: Interactive Computer Graphics. Projection

CS 432 Interactive Computer Graphics

Lecture 4. Viewing, Projection and Viewport Transformations

Viewing. Reading: Angel Ch.5

Projection Lecture Series

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

Computer Graphics (CS 543) Lecture 6a: Viewing & Camera Control. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Chapter 3 - Basic Mathematics for 3D Computer Graphics

CS 543: Computer Graphics Lecture 6 (Part I): 3D Viewing and Camera Control. Emmanuel Agu

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 Graphics for Game Programming (J. Han) Chapter II Vertex Processing

MORE OPENGL. Pramook Khungurn CS 4621, Fall 2011

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

Transformations (Rotations with Quaternions) October 24, 2005

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

3D Viewing Episode 2

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

Reminder: Affine Transformations. Viewing and Projection. Shear Transformations. Transformation Matrices in OpenGL. Specification via Ratios

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations

CS452/552; EE465/505. Review & Examples

Transformation Pipeline

Prof. Feng Liu. Fall /19/2016

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Computer Graphics. Bing-Yu Chen National Taiwan University

Chap 7, 2008 Spring Yeong Gil Shin

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013

Overview. By end of the week:

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

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

1 (Practice 1) Introduction to OpenGL

Computer Graphics 7: Viewing in 3-D

Transcription:

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

Classical Viewing

Viewing plane

projectors

Classical Viewing Viewing requires three basic elements - One or more objects (the model) - A viewer with a projection surface - Projectors that go from the object(s) to the projection surface Classical views are based on the relationship among these elements Each object is assumed to constructed from flat principal faces - Buildings, polyhedral, manufactured objects 5

Planar Geometric Projections Standard projections project onto a plane(the view/projection plane) Projectors are lines that either - converge at a center of projection - are parallel Such projections preserve lines - but not necessarily angles Nonplanar projections are needed for applications such as map construction 6

Taxonomy of Planar Geometric Projections planar geometric projections parallel perspective multiview orthographic 1 point 2 point 3 point oblique 7

Perspective Projection 10

Parallel Projection 11

Projections

Taxonomy of Planar Geometric Projections planar geometric projections parallel perspective multiview orthographic 1 point 2 point 3 point oblique 13

Orthographic Projection Projectors are orthogonal to projection surface 14

Multiview Orthographic Projection Projection plane parallel to principal face Usually form front, top, side views isometric (not multiview orthographic view) front in CAD and architecture, we often display three multiviews plus isometric top side 15

Advantages and Disadvantages Preserves both distances and angles - Shapes preserved - Can be used for measurements Building plans Manuals Cannot see what object really looks like because many surfaces hidden from view - Often we add the isometric 16

Taxonomy of Planar Geometric Projections planar geometric projections parallel perspective multiview orthographic 1 point 2 point 3 point oblique 21

Oblique Projection Arbitrary relationship between projectors and projection plane 22

Advantages and Disadvantages Can pick the angles to emphasize a particular face - Architecture: plan oblique, elevation oblique Angles in faces parallel to projection plane are preserved while we can still see around side In physical world, cannot create with simple camera; possible with bellows camera or special lens (architectural) 23

Taxonomy of Planar Geometric Projections planar geometric projections parallel perspective multiview orthographic 1 point 2 point 3 point oblique 24

Perspective Projection Projectors converge at center of projection 25

Vanishing Points Parallel lines (not parallel to the projection plan) on the object converge at a single point in the projection (the vanishing point) Drawing simple perspectives by hand uses these vanishing point(s) vanishing point 27

One-Point Perspective One principal face parallel to projection plane One vanishing point for cube 28

Two-Point Perspective On principal direction parallel to projection plane Two vanishing points for cube 29

Three-Point Perspective No principal face parallel to projection plane Three vanishing points for cube 30

Advantages and Disadvantages Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminution) - Looks realistic Equal distances along a line are not projected into equal distances (nonuniform foreshortening) Angles preserved only in planes parallel to the projection plane More difficult to construct by hand than parallel projections (but not more difficult by computer) 31

3D viewing

THE THREE-DIMENSIONAL VIEWING PIPELINE

Computer Viewing three aspects of the viewing Pipline, - Positioning the camera Setting the model-view matrix - Selecting a lens or projection type Setting the projection matrix - Clipping and normalization Setting the view volume Normalizing the view volume 34

The OpenGL Default Camera In OpenGL, initially the object and camera frames are the same - Default model-view matrix is an identity The camera is located at origin and points in the negative z direction 35

Default Projection Default projection is orthogonal - Default projection matrix is an identity 2 clipped out z=0 36

Default veiw volume OpenGL also specifies a default view volume that is a cube with sides of length 2 centered at the origin

Moving the Camera Frame If we want to visualize object with both positive and negative z values we can either - Move the camera in the positive z direction Translate the camera frame - Move the objects in the negative z direction Translate the world frame Both of these views are equivalent and are determined by the model-view matrix - Want a translation (gltranslatef(0.0,0.0,-d);) -d > 0 38

Moving Camera back from Origin default frames frames after translation by d d > 0 39

Moving the Camera We can move the camera to any desired position by a sequence of rotations and translations Example: side view - Rotate the camera - Move it away from origin - Model-view matrix C = TR 40

Camera in OpenGL

OpenGL code Remember that last transformation specified is first to be applied glmatrixmode(gl_modelview) glloadidentity(); gltranslatef(0.0, 0.0, -d); glrotatef(90.0, 0.0, 1.0, 0.0); 42

The LookAt Function The GLU library contains the function glulookat to form the required modelview matrix through a simple interface Note the need for setting an up direction Still need to initialize - Can concatenate with modeling transformations Example: isometric view of cube aligned with axes glmatrixmode(gl_modelview); glloadidentity(); glulookat(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0. 0.0); 43

glulookat gllookat(eyex, eyey, eyez, atx, aty, atz, upx, upy, upz) 44

Other Viewing APIs The LookAt function is only one possible API for positioning the camera Others include - View reference point, view plane normal, view up (PHIGS, GKS-3D) - Yaw, pitch, roll - Elevation, azimuth, twist - Direction angles 45

Projection, clipping window, view volume

Clipping window

Orthogonal projection and clipping window

Orthogonal view volume

Oblique projection and clipping window

Prespective and cliping window

Prespective view volume

Projections in OpenGL

OpenGL Orthogonal Viewing glortho(left,right,bottom,top,near,far) near and far measured from camera 60

OpenGL Perspective glfrustum(left,right,bottom,top,near,far) 61

Using Field of View With glfrustum it is often difficult to get the desired view gluperspective(fovy, aspect, near, far) often provides a better interface front plane aspect = w/h 62