CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.

Slides:



Advertisements
Similar presentations
Three Dimensional Viewing
Advertisements

1 Computer Graphics Chapter 8 3D Transformations.
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
Shared Graphics Skills Cameras and Clipping Planes
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
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.
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
The Pinhole Camera Model
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Cameras, lenses, and calibration
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
Viewing and Projections
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Advanced Computer Graphics Three Dimensional Viewing
Week 2 - Wednesday CS361.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Transformations Jehee Lee Seoul National University.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
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.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
1 Computer Graphics Week9 -3D Geometric Transformation.
Chapter Nine Vectors and the Geometry of Space. Section 9.1 Three-Dimensional Coordinate Systems Goals Goals Become familiar with three-dimensional rectangular.
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
University of North Carolina at Greensboro
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Geometric Transformations
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Three-Dimensional Viewing
Three-Dimensional Viewing Hearn & Baker Chapter 7
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Computer Graphics, KKU. Lecture 41 The Computer Programming Laws Any given program, when running, is obsolete. Any given program costs more and.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Computer Graphics Matrices
Viewing and Projection
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
DEFINITION The position of any object lying in a plane can be represented with the help of two perpendicular line. In case of seating plan we require.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Chapter 1 Graphics Systems and Models Models and Architectures.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
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
Introduction to Computer Graphics
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
CSCE 441 Computer Graphics 3-D Viewing
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.
Three Dimensional Viewing
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Last Time Canonical view pipeline Projection Local Coordinate Space
Presentation transcript:

CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA

LEARNING OBJECTIVES In this chapter you will learn about: – –3D Cartesian coordinate systems – –The synthetic-camera model – –The viewing system – –The view volume – –Culling – –Clipping – –Changing coordinate systems – –Viewing transformations – –The modeling/world transformation – –The projection transformation – –The viewport transformation

LEARNING OBJECTIVES In this chapter you will learn about: – –Spatial transformations – –Translation – –Rotation – –Scaling – –Drawing a triangle without any transformations – –Drawing a triangle translated – –Drawing a triangle rotated – –Drawing a triangle scaled

3D CARTESIAN COORDINATE SYSTEMS The field of computer graphics relies heavily on vector calculations and matrix transformations. These calculations, along with the Cartesian coordinate system, are based on numbers indicating distances. The Cartesian coordinate system is consequently the most fundamental system for the unique identification of arbitrary points in space.

3D CARTESIAN COORDINATE SYSTEMS Two kinds of Cartesian coordinate systems: – –two-dimensional – –three-dimensional

3D CARTESIAN COORDINATE SYSTEMS A two-dimensional Cartesian coordinate system consists of an origin intersected by two axes perpendicular to each other. – –The vertical axis is known as the y-axis and the horizontal axis, the x-axis.

3D CARTESIAN COORDINATE SYSTEMS The three-dimensional Cartesian coordinate system provides an additional dimension for spatial measurement by means of a diagonal z- axis.

3D CARTESIAN COORDINATE SYSTEMS Vertex coordinates are written in the form (x, y, z), with xy-, xz-, and yz-planes dividing the coordinate space into eight areas.

3D CARTESIAN COORDINATE SYSTEMS Device independent coordinate systems function on the principle of translating between world and device or screen coordinates (the coordinate system used by the graphics display). Graphics systems are primarily based on either the left-handed or right-handed Cartesian coordinate system.

3D CARTESIAN COORDINATE SYSTEMS

THE SYNTHETIC-CAMERA MODEL The Synthetic-Camera Model is an optical imaging paradigm for three-dimensional computer graphics. This paradigm is based on the pinhole camera model where image formation is a simple process based on a film plane located at a distance, s, from an opening (the pinhole).

THE SYNTHETIC-CAMERA MODEL The synthetic camera model adds several principles to the pinhole camera model for the representation of artificial images.

THE SYNTHETIC-CAMERA MODEL The virtual image plane is also responsible for controlling the clipping of observed objects.

THE VIEWING SYSTEM The viewing system is a unified model for image visualization and consists of a view coordinate system and point of view. These two components establish the viewer’s position in terms of world coordinates. The coordinate system is specified with respect to this point of view.

THE VIEWING SYSTEM The point of view can either be the origin of the coordinate system, or the center of projection. The viewing system must also contain an image plane for the projection of scenes and a view frustum/volume for the specification of the field of view.

THE VIEWING SYSTEM

The View Volume – –a semi-infinite, truncated pyramid defined by an image plane window and a near and far clipping plane. Culling – –also known as back-face elimination, removes polygons hidden from the viewer. Clipping – –an optimization operation responsible for the display of only visible objects.

THE VIEWING SYSTEM

CHANGING COORDINATE SYSTEMS It’s often necessary to define geometry in terms of a coordinate system innately fitting the representation of a model. Such a coordinate system is referred to as the object or model frame (also known as model space) where vertices are defined relative to the modeling coordinate system’s origin.

CHANGING COORDINATE SYSTEMS This model frame must be converted to the world frame (all vertices are defined relative to a mutual origin) for proper model representation. Once we’ve converted the model frame to the world frame we still have no idea how these models would appear to the camera.

CHANGING COORDINATE SYSTEMS To accomplish this we need to change the coordinate system from the world frame to the camera or view frame with the viewer at the origin of the camera’s lens looking in the positive z-direction. This switch in coordinate systems is accomplished with the world and view matrices via the viewing transformation for Direct3D and the modelview matrix for OpenGL.

CHANGING COORDINATE SYSTEMS Viewing Transformation Modeling Transformation Projection Transformation Viewport Transformation

SPATIAL TRANSFORMATIONS Here Here we focus on three-dimensional transformations such as rotation, scaling, and translation. A transformation is an operation that moves a vertex or vector from one point in space to another. These transformations are denoted by a matrix with several matrices often combined for a custom transformation. Affine transformation is simply a term used to describe a sequence of linear transformations (rotation, scaling, etc.) followed by a translation operation. A linear transformation or linear map is a function that maps objects (vertices and vectors) from one vector space to another.

SPATIAL TRANSFORMATIONS Translation

SPATIAL TRANSFORMATIONS Rotation

SPATIAL TRANSFORMATIONS

Scaling

Examples Rendering a triangle without any transformations – –[see the textbook and source code “BasicTriangle (Direct3D)” on the book’s website for a detailed example].

Examples Rendering a triangle translated – –[see the textbook and source code “BasicTriangleTranslated (Direct3D)” on the book’s website for a detailed example].

Examples Rendering a triangle rotated – –[see the textbook and source code “BasicTriangleRotated (Direct3D)” on the book’s website for a detailed example].

Examples Rendering a scaled triangle – –[see the textbook and source code “BasicTriangleScaled (Direct3D)” on the book’s website for a detailed example].

Examples Working with OpenGL: Translation, Rotation and Scaling – –[see the textbook and source code “Translation, Rotation and Scaling (OpenGL)” on the book’s website for a detailed example].