THREE-DIMENSIONAL VIEWING II

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
1 View Shandong University Software College Instructor: Zhou Yuanfeng
Based on slides created by Edward Angel
Viewing and Transformation
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Introduction to 3D viewing 3D is just like taking a photograph!
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
Advanced Computer Graphics Three Dimensional Viewing
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Camera. Content Coordinate systems and transformations Viewing coordinates Coordinate transformation matrix Projections Window and viewport Acknowledgments:
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 67 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 67 Computer Graphics Three-Dimensional Graphics III.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Demetriou/Loizidou – ACSC330 – Chapter 5 Viewing Dr. Giorgos A. Demetriou Computer Science Frederick Institute of Technology.
Computer Graphics I, Fall 2010 Computer Viewing.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Three-Dimensional Viewing Hearn & Baker Chapter 7
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
OpenGL LAB III.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
3 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Viewing Viewing and viewing space (camera space)
Computer Graphics CC416 Week 14 3D Graphics.
Viewing.
Computer Viewing.
Courtesy of Drs. Carol O’Sullivan / Yann Morvan Trinity College Dublin
Isaac Gang University of Mary Hardin-Baylor
3D Viewing cgvr.korea.ac.kr.
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
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.
3D Transformation Pipeline
Projections and Normalization
CSC461: Lecture 19 Computer Viewing
Fundamentals of Computer Graphics Part 5 Viewing
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Three-Dimensional Viewing
Last Time Canonical view pipeline Projection Local Coordinate Space
3D Graphics.
Chap 3 Viewing Pipeline Reading:
Type of View Perspective View COP(Center of Plane) Diminution of size
Viewing (Projections)
University of New Mexico
Viewing (Projections)
Interactive Computer Graphics Viewing
3D Viewing.
THREE-DIMENSIONAL VIEWING
CS 352: Computer Graphics Chapter 5: Viewing.
Presentation transcript:

THREE-DIMENSIONAL VIEWING II 12 고려대학교 컴퓨터 학과 김 창 헌

Contents Viewing Pipeline Viewing Coordinates Specifying the Viewing Coordinates Transformation from WC to VC View Volumes and Projection Transformations Clipping Hardware Implementations 3D Viewing Functions Summary

Viewing Pipeline General 3D Transformation Pipeline Clipping against Modeling Coordinates Modeling Transformation World Coordinates Viewing Transformation Viewing Coordinates Clipping against Viewing volume Projection Transformation Projection Coordinates Workstation Transformation Device Coordinates Project onto Projection plane

The Human Visual System Cornea (각막) : 렌즈를 보호하는 투명막 Iris (홍채) : 눈에 들어오는 빛의 양을 조절 Lens : 3차원의 물체를 투영하여 2차원의 이미지를 형성함 Retina (망막) : 투영된 이미지가 맺히는 곳 Rods and Cones (시신경의 간상체) : 빛을 감지하는 신경

The simplest camera geometric model ! The Pinhole Camera The simplest camera geometric model ! Side view Angle of view(field) The angle made by the largest object that our camera can image on its film plane

The Synthetic Camera Model Equivalent views of image formation Imaging with the sythetic camera Imaging system Projection Plane Center of Projection Projection Plane Equivalent views of image formation

Clipping (a) with window in initial position (b) with window shifted Clipping window Clipping (a) with window in initial position (b) with window shifted

The Programmer’s Interface Position The camera location usually is given by the position of the center of the lens(the center of projection) Orientation Place a camera coordinate system with its origin at the center of projection Focal length The focal length of the lens determines the size of the image on the film plane Flim plane The back of the camera has a height andq width Camera specification

Viewing Coordinates Camera positioning VRP VPN VUP Specifying the view plane ! Use A viewing API Set_view_reference_point(x,y,z); VRP Set_view_plane_normal(nx,ny,nz); VPN Set_view_up(ux,uy,uz); VUP

Viewing Coordinate System 1. View reference point (VRP) - The camera position in the World-coordinate system - The origin of Viewing-coordinate system VPN(n) VRP VUP(v) zw xw yw u UVN coordinate system 2. View-plane normal (VPN) - The positive direction for the viewing zv axis 3. View- up vector (VUP) - Specify what direction is up to the camera - To establish the positive direction for the yv axis, VUP is adjusted to a position perpendicular to the normal vector VPN View plane 4. Set up the u vector - Using vectors N and V, determine the right-handed viewing system

Camera Positioning in OpenGL 1. Using the Model View Matrices The Camera Positioning Movement of the world frames Ex) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0,0.0,-d); glRotatef(-90.0,0.0,1.0,0.0); Movement of the world frames a) Initial camera position b) After change in the model view matrix

Camera Positioning in OpenGL 2. Using the Look-At Function gluLookAt(eyex,eyey,eyez,atx,aty,atz,upx,upy,upz); Look-at positioning

Positioning of the Camera Other Viewing APIs Roll,pitch and yaw Elevation and azimuth

Transformation from WC to VC Transformation sequences 1. Translate the view reference point to the origin of the WC system 2. Apply rotations to align the xv, yv, and zv axes with the world axes General sequence of translate-rotate transformation

Transformation from WC to VC (con’t) Translation view reference point(x0, y0, z0) Rotation rotate around the world xw axis to bring zv into the xwzw plane rotate around the world yw axis to align the zw and zv axis final rotation is about the zw axis to align the yw and yv axis

Transformation from WC to VC (con’t) Direct generating the rotation-transformation matrix

View Window and View Volume Definition of a View Volume View window - How much of the scene is caught on film - Can be placed any where on the view plane View volume - Only those objects within it will appear in the display - The volume size depends on the view window size - While its shape depends on the type of the projection

View Volumes and Projection View volume boundary Near plane(Front plane) Far plane(Back plane) View window Parallelpiped Volume View Frustum Projection reference point

glFrustum(left,right,bottom,top,near,far); Projections in OpenGL 1. Perspective Projection in OpenGL glFrustum(left,right,bottom,top,near,far); View point near far left right top bottom

gluPerspective(fovy,aspect,zNear,zFar); Projections in OpenGL gluPerspective(fovy,aspect,zNear,zFar); aspect = w/h  w h View point fovy near far

glOrtho(left,right,bottom,top,near,far); Projections in OpenGL 2. Parallel Projection in OpenGL glOrtho(left,right,bottom,top,near,far); left top Toward the view point right bottom near far

Viewport Transformation Mapping the Viewing volume to the Viewport glViewport( x, y, width, height); gluPerspective(myFovy,10.0, myNear, myFar); glViewport(0,0,400,400); gluPerspective(myFovy,10.0, myNear, myFar); glViewport(0,0,400,200);

OpenGL Viewing Summary Ex) A Transformed Cube void CALLBACK myReshape() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-1.0,1.0,-1.0,1.0,1.5,20.0); glMatrixMode(GL_MODELVIEW); glViewport(0,0,w,h); } void main() auxInitDisplayMode(AUX_SINGLE |AUX_RGBA); auxInitPosition(0,0,500,500); auxReshapeFunc(myReshape); auxMainLoop(display); #include <GL/glos.h> #include <GL/gl.h> #include <GL/glu.h> #include <GL/glaux.h> void CALLBACK display () { glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,1.0,1.0); glLoadIdentity(); glTranslatef(0.0,0.0,-5.0); glScalef(1.0,2.0,1.0); auxWireCube(1.0); glFlush(); } Define the Projection Define the Viewport ( w,h : Window Size ) Initial Position of the Window Positioning/ Scaling of the Camera

View Volume Properties Changing the shape of the oblique-projection view volume by moving the window Changing perspective effects by moving the projection reference point

View Volume Properties Projected object size depends on the view plane position relative to the position of the PRP Simulate the Camera moving in Animation - PRP move with the VRP

General Parallel-Projection Transformation General Parallel-Projection Process Eliminating Z coordinate Oblique projection vector and view volume Regular view volume after shearing

General Parallel-Projection Transformation ※ Relationship between Vp and L,, and 

General Perspective-Projection Transformation 1. Shear the view voume so that the centerline of the frustum is perpendicular to the view plane 2. Scale the view volume with a scaling factor that depends on 1/z Frustum Centerline zv (x,y,z) (x’,y’,z’) (x”,y”,z”) View plane View plane (xprp, yprp, zprp) Shearing View volume Pyramid into a Box

General Perspective-Projection Transformation Step 1. Step 2.

Clipping Clipping Identify and save all surface segments within the view volume View-volume clipping boundary : planes

Normalized View Volumes Normalized View Volumes  Why? View Volume

Normalized View Volumes (con’t) Pipeline

Normalized View Volumes (con’t) Advantages provides a standard shape for representing any sized view volume clipping procedures are simplified and standardized with unit cube depth cueing and visible-surface determination are simplified Mapping position within a rectangular view volume to a 3D rectangular viewport Translation factors Ratios of the dimensions of the viewport and view volume

1. Parametric line equation Viewport Clipping 1. Parametric line equation 2. Calculation of parameter value 3. Intersection point Side view of two line segments that are to be clipped

Clipping in Homogeneous Clipping in Homogeneous Coordinates

Hardware Implementations

3D Viewing Functions Multiple Views Using Difference Camera Orientations

3D Viewing Functions (con’t) A Wide-Angle Perspective Display Same viewing position, but with slight shifts in the viewing direction

Summary Modeling Coordinates Modeling Transformation World Coordinates Viewing Transformation Viewing Coordinates Projection Transformation Projection Coordinates Workstation Transformation Device Coordinates