Three-Dimensional Viewing

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
Projection.
Shared Graphics Skills Cameras and Clipping Planes
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
CS485/685 Computer Vision Prof. George Bebis
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Three-Dimensional Concepts
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Visualization- Determining Depth From Stereo Saurav Basu BITS Pilani 2002.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Viewing and Projections
Computer Graphics (fall 2009)
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
Advanced Computer Graphics Three Dimensional Viewing
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Camera. Content Coordinate systems and transformations Viewing coordinates Coordinate transformation matrix Projections Window and viewport Acknowledgments:
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Mark Nelson 3d projections Fall 2013
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Three-Dimensional Viewing
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
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 and Projection
1 PTT 105/3: Engineering Graphics. TAXONOMY OF PLANAR GEOMETRIC PROJECTIONS PTT 105/3: Engineering Graphics 2 Planar Geometric Projections Parallel Multiview.
CS-321 Dr. Mark L. Hornick 1 Three-Dimensional Graphics Problem How can you effectively display 3-D information on a 2-D display?
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
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.
Chapter: Viewing.
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
Computer Graphics Projections.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
Introduction to Computer Graphics
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Visible Surface Detection
Rendering Pipeline Fall, 2015.
Computer Graphics CC416 Week 14 3D Graphics.
University of North Carolina at Greensboro
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.
CENG 477 Introduction to Computer Graphics
Three-Dimensional Concepts. Three Dimensional Graphics  It is the field of computer graphics that deals with generating and displaying three dimensional.
Three Dimensional Viewing
Viewing (Projections)
Viewing (Projections)
Presentation transcript:

Three-Dimensional Viewing PPT6 - Intro to Computer Graphics Mehrad Eslami mehrad@mail.usf.edu EEL-5771-001

3D Viewing Concepts It is the field of computer graphics that deals with generating and displaying three dimensional objects in a two-dimensional space(eg: display screen) In addition to color and brightness, a 3-D pixels adds a depth property that indicates where the point lies on the imaginary z- axis. When many 3-D pixels are combined, each with its own depth value, the result is a 3-D surface called a texture. Objects are created on a 3-D stage where the current view is derived from the camera and light sources, similar to the real world.

3D Viewing Concepts

Three-Dimensional Display Methods Parallel projection Project points on the object surface along parallel lines onto the display plane. Parallel lines are still parallel after projection. Used in engineering and architectural drawings. Perspective projection Project points to the display plane along converging paths. This is the way that our eyes and a camera lens form images and so the displays are more realistic.

Three-Dimensional Display Methods Visible line and surface identification Highlight the visible lines or display them in different color Display nonvisible lines as dashed lines Remove the nonvisible lines Depth Cueing To easily identify the front and back of display objects. Depth information can be included using various methods. A simple method to vary the intensity of objects according to their distance from the viewing position. Eg: lines closest to the viewing position are displayed with the highest intensities and lines farther away are displayed with decreasing intensities.

Parallel projection By selecting different viewing positions, we can project visible points on the object onto the display plane to obtain different two-dimensional views of the object.

Perspective projection It has two major characteristics Smaller as their distance from the observer increases. Foreshortened: the size of an object’s dimension along the line of sight are relatively shorter than dimensions across the line of sight.

Visible Line and Surface

Depth Cueing Application is modeling the effect of the atmosphere on the pixel intensity of objects. More distant objects appear dimmer to us than nearer objects due to light scattering by dust particles, smoke etc.

Wire frame The wireframe model is perhaps the oldest way of representing solids. A wireframe model consists of two tables, the vertex table and the edge table. Each entry of the vertex table records a vertex and its coordinate values, while each entry of the edge table has two components giving the two incident vertices of that edge. A wireframe model does not have face information. For example, to represent a cube defined by eight vertices and 12 edges. Because of wireframe models are ambiguous, their uses are limited. However, wireframe models are popular, because they are efficient (i.e., only vertices and edges are displayed and processed) when they work. For example, wireframe models can be used for preview purpose. Rendering a complex model or an animation sequence could be very time consuming if all objects are to be rendered. If wireframe models (usually including its face information) are available, one can easily obtain a general feeling of the final result without waiting for minutes or even hours before spotting a design flaw.

Wire frame 16 vertices and 32 edges on the right 8 vertices and 12 edges on the left

Projection Coordinates 3D Viewing Pipeline Process Construct World-Coordinate Scene From Modeling-Coordinate Transformations World Coordinates Modeling Coordinates Convert World- Coordinates to Viewing- Coordinates Coordinates Viewing Projection Transformation Projection Coordinates Transform Projection-Coordinates to Normalized-Coordinates Normalized Coordinates Map Normalized- Coordinates to Device-Coordinates Device Coordinates

3D Viewing pipeline Pipeline has +/ same structure as in 2D Similar to making a photo Position and point virtuele camera, press button; Projection plane aka Viewing plane Pipeline has +/ same structure as in 2D

3D viewing coordinates P0, Pref , V: define viewing coordinate system zvp Specification of projection: P0 : View or eye point Pref : Center or look-at point V: View-up vector (projection along vertical axis) zvp : positie view plane yw P0 N V Pref xw zw P0, Pref , V: define viewing coordinate system Several variants possible

3D viewing coordinates P0, Pref , V: define viewing coordinate system xview yview zview yw P0 N V Pref xw zw P0, Pref , V: define viewing coordinate system Several variants possible

3D view coordinates n xview yview u v yw zview P0 N V Pref xw zw

3D view coordinates xview yview u v zview yw n P0 N V Pref xw zw

Octagonal projections Orthogonal projection is a means of representing a three- dimensional object in two dimensions. It is a form of parallel projection, where all the projection lines are orthogonal to the projection plane, resulting in every plane of the scene appearing in affine transformation on the viewing surface. It is further divided into multiview orthographic projections and axonometric projections. In computer graphics, one of the most common matrices used for orthographic projection can be defined by a 6-tuple, which defines the clipping planes. We’ll see in next slides how a orthogonal works in term of projecting 3D to 2D.

Orthogonal projections The box is translated so that its center is at the origin, then it is scaled to the unit cube which is defined by having a minimum corner at (-1,-1,-1) and a maximum corner at (1,1,1). The orthographic transform can be given by the following matrix:

Orthogonal projections Which can be given as a scaling followed by a translation of the form The inversion of the Projection Matrix, which can be used as the Unprojection Matrix is defined:

Orthogonal projections Parallell projection: Projection lines are parallel Orthogonal projection: Projection lines are parallel and perpendicular to projection plane Isometric projection: Projection lines are parallel, perpendicular to projection plane, and have the same angle with axes. P’2 P1 P’1 P2 P1 P’2 P’1 z x y

Orthogonal projections

Orthogonal projections View volume Clipping window yview Near plane Far plane xview zview

Orthogonal projections (xwmax, ywmax, zfar) View volume yview xview zview (xwmin, ywmin, znear)

Orthogonal projections (xwmax, ywmax, zfar) znorm xnorm ynorm Normalized View volume (1,1,1) (-1,-1,-1) yview xview zview (xwmin, ywmin, znear) View volume Translation Scaling From right- to left handed

Parallel Projection Point (x,y,z) is projected to position (xp,yp) on the view plane. Projector (oblique) from (x,y,z) to (xp,yp) makes an angle with the line (L) on the projection plane that joins (xp,yp) and (x,y). Line L is at an angle with the horizontal direction in the projection plane.

Parallel Projection

Parallel Projection Orthographic Projection:

Transformation When the human eye views a scene, objects in the distance appear smaller than objects close by - this is known as perspective. While orthographic projection ignores this effect to allow accurate measurements, perspective projection shows distant objects as smaller to provide additional realism. The standard way to represent 2D/3D transformations nowadays is by using homogeneous coordinates. [x,y,w] for 2D, and [x,y,z,w] for 3D. Since we have three axes in 3D as well as translation, that information fits perfectly in a 4x4 transformation matrix.

Transformation Transform your 3D points with the inverse camera matrix, followed with whatever transformations they need. If you have surface normal, transform them as well but with w set to zero, as you don't want to translate normal. The matrix you transform normal with must be isotropic; scaling and shearing makes the normal malformed. Transform the point with a clip space matrix. This matrix scales x and y with the field-of-view and aspect ratio, scales z by the near and far clipping planes, and plugs the 'old' z into w. After the transformation, you should divide x, y and z by w. This is called the perspective divide.

Transformation Now your vertices are in clip space, and you want to perform clipping so you don't render any pixels outside the viewport bounds. Sutherland-Hodgeman clipping is the most widespread clipping algorithm in use. Transform x and y with respect to w and the half-width and half-height. Your x and y coordinates are now in viewport coordinates. w is discarded, but 1/w and z is usually saved because 1/w is required to do perspective-correct interpolation across the polygon surface, and z is stored in the z-buffer and used for depth testing.

Perspective projection View plane: z = zvp P2 P’2 P1 Projection reference point P’1 yview xview zview View plane: orthogonal to zview axis.

Perspective projection View plane: z = zvp P = (x, y, z) R: Projection reference point (xp, yp, zp) (xr, yr, zr) yview To simplify, Assume R in origin xview zview Question: What is the projection of P on the view plane?

Perspective projection View plane: z = zvp P = (x, y, z) yview (xp, yp, zp) xview zview R= (0,0, 0)

Perspective projection P = (x, y, z) View plane yview y zvp yp R zview z Viewed from the side

Perspective projection Clipping window in View plane Ratio between W=wmaxwmin and zvp determines strenght perspective P = (x, y, z) wmax yview R zview W zvp wmin Viewed from the side

Perspective projection Clipping window in View plane Ratio between W=wmaxwmin and zvp determines strenght perspective. This ratio is 2tan(/2), with  the view angle. yview R  zview Viewed from the side

Perspective projection yview R zview

Perspective projection yview R zview

Perspective projection

Perspective projection Option 1: Specify view angle .  yview R zview W zvp How to specify the ratio between W en zvp? How to specify ‘how much’ perspective I want to see?

Perspective projection yview f (mm) 24 mm R zview W zvp Use camera as metaphor. User specifies focal length f . (20 mm – wide angle, 50 mm – normal, 100 mm – tele). Application adjusts W and/or zvp, such that W/zvp = 24/f. For x: W/zvp = 36/f.

Perspective projection ynorm yview Side view Front view znorm R zview Perspective transformation: Distort space, such that perpendicular projection gives an image in perspective.

Perspective projection ynorm yview znorm 2r R zview zn zf Simplest case: Square window, clipping plane coincides with view plane: zn=zvp

Perspective projection (-r, -r, zn) ((zf /zn)r, (zf /zn)r, zf ) ynorm (-1,-1,-1) (1,1,1) yview znorm 2r R zview zn zf

Perspective projection (r,  r, zn) (rzf /zn, rzf /zn, zf ) ynorm (1, 1, 1) (1,1,1) yview znorm R zview Earlier: How to put this transformation in the pipeline? How to process division by z?

Perspective projection (r, r, zn) (rzf /zn, rzf /zn, zf ) (1, 1, 1) (1,1,1) ynorm yview znorm R zview

Perspective projection (r, r, zn) (rzf /zn, rzf /zn, zf ) (1, 1, 1) (1,1,1) ynorm yview znorm R zview

Perspective projection

View volume perspective Clipping window yview xview Far clipping plane zview R Near clipping plane

Normalizing view volume (1,1,1) zview xview yview R ynorm znorm xnorm (1, 1, 1) Normalized View volume Rectangular frustum View Volume

Normalized view volume Normalize Matrix Normalizing formula Dx= Dy= Dz= Kx= Ky= Kz=

References Chen, Jim X. "Foundations of 3D Graphics Programming - Using JOGL and Java3D | Jim X. Chen | Springer.” Foundations of 3D Graphics Programming - Using JOGL and Java3D | Jim X. Chen | Springer. Springer, n.d. Web. 06 Oct. 2015. Wijk, Jack Van. "2IV60 Computer Graphics 2014/2015.” 2IV60 Computer Graphics. N.p., n.d. Web. 06 Oct. 2015. Younesi, and Malaek, Dr. "Three Diminutionals Viewing." N.p., n.d. Web. Luebke, David. "UVA Computer Graphics: Courses.”UVA Computer Graphics: Courses. N.p., n.d. Web. 06 Oct. 2006. Wimer, Shmuel. "Computer Graphics Viewing." N.p., May 2010. Web. "3D Computer Graphics.” Wikipedia. Wikimedia Foundation, n.d. Web. 06 Oct. 2015. "Computer Graphics.” Wikipedia. Wikimedia Foundation, n.d. Web. 06 Oct. 2015. Sung, K., P. Shirley, and S. Baer. "Essentials of Interactive Computer Graphics Concepts and Implementation." N.p., n.d. Web. 06 Oct. 2015. *some pictures and formulas have copied from the references

Thank You