CS447 3-1 Mastering 2D & 3D Computer Graphics Pipelines Introduction to 2D and 3D Computer Graphics.

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
Advertisements

SI23 Introduction to Computer Graphics
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Three Dimensional Viewing
Geometric Transformations
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Based on slides created by Edward Angel
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation.
Sep 21, Fall 2005ITCS4010/ Computer Graphics Overview Color Displays Drawing Pipeline.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
Sep 21, Fall 2006IAT 4101 Computer Graphics Overview Color Displays Drawing Pipeline.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
CS447/ Introduction to Display Lists and 3D Viewing Introduction to 2D and 3D Computer Graphics.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Week 2 - Wednesday CS361.
Geometric Transforms Changing coordinate systems.
 2D Transformations 2D Transformations  Translation Translation  Rotation Rotation  Scaling Scaling.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Geometric Objects and Transformation
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
1 Computer Graphics Week9 -3D Geometric Transformation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Transformational Geometry CS418 Computer Graphics John C. Hart.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
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.
Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lecture 3 Transformations. 2D Object Transformations The functions used for modifying the size, location, and orientation of objects or of the camera.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Matrices
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Computer Graphics Overview
Geometric Transformations
Review: Transformations
3D Geometric Transformations
3D Viewing cgvr.korea.ac.kr.
Introduction to Computer Graphics CS 445 / 645
CENG 477 Introduction to Computer Graphics
Line and Character Attributes 2-D Transformation
Chapter IV Spaces and Transforms
Geometric Objects and Transformations (II)
Presentation transcript:

CS Mastering 2D & 3D Computer Graphics Pipelines Introduction to 2D and 3D Computer Graphics

CS What are pipelines? What are the fundamental components of pipelines? Example pipelines... –...2D graphic object pipeline –...3D graphic object pipeline –...raster pipeline –...bitmapped, HLHSR, illumination implications Mastering 2D & 3D Graphics Overview of 2D & 3D Pipelines

CS Overview of 2D & 3D Pipelines What are Pipelines? Are the fundamental concept around which graphics systems are based Represent conceptual models Describe the interaction and the flow of data for all functions Illustrate how the applications can create, save, modify, draw, and display pictures

CS Illustrate how applications can create pictures Illustrate the use of functions to set up the environment Illustrate how the environment affects pictures being created Illustrate the interactions and the relationships between functions Overview of 2D & 3D Pipelines What are Pipelines?

CS Overview of 2D & 3D Pipelines What are the fundamental components? Common components: –Attribute Association –Display-List Storage –Bundled Attribute Association –Modeling –Viewing & Clipping –Rendering »with many sub-components!

CS Overview of 2D & 3D Pipelines Attribute Association: pipeline illustration

CS Overview of 2D & 3D Pipelines Bundled Attribute Association Attributes set and accessed through tables... –...are called bundled attributes –...are grouped into bundle tables –...can change the attributes associated with a graphic object as it flows along the pipeline

CS Overview of 2D & 3D Pipelines Display-List Storage Segment models...(e.g., CGI, GKS) –...describe the mechanism for saving graphic objects Structure models...(e.g., PHIGS) –...describe the mechanism for saving primitive and complex elements Macro & procedure models...(e.g., POSTSCRIPT®) –…describe the mechanism for saving macros, procedures, & subroutines in memory for later use

CS One Approach to Display Lists using segments

CS Application Program: Workstation Independent...these functions cause elements to flow along the pipeline and into centralized structure storage: set polyline colour index (red) set linewidth scale factor (wide) set linetype (dashed) polyline 3 ( )...functions that create elements: SET POLYLINE COLOUR INDEX (Red) SET LINEWIDTH SCALE FACTOR(Wide) SET LINETYPE(Dashed) POLYLINE 3 ( ) Or, with Structures... Structure Creation: data definition process

CS Display Process... workstation independent Display Process... workstation dependent Data Defini- tion Process Centralized Structure Store Modeling Viewing & View Clipping Associate Attributes Associate bundled attributes Rendering Overview of 2D & 3D Pipelines Example: 3D graphic object pipeline

CS Modeling transformations... –...allow objects to be defined in their own coordinate system Through modeling... –...objects are transformed into world coordinates by scaling, rotation, and/or translation Overview of 2D & 3D Pipelines Modeling

CS This allows all objects to initially be defined as centered around the origin... –...and then modeling transformations can position, orient, and scale them into their correct geometric relationships This stage in the pipeline is independent of the display characteristics Overview of 2D & 3D Pipelines Modeling

CS The modeling transformation... –...maps modeling coordinates into world coordinates –...is defined by transformation matrices inserted into a structure network –...allows the picture to be composed of separate parts, each defined within its own modeling coordinate system –...supports relative positioning of these parts when they are mapped to world coordinates Overview of 2D & 3D Pipelines Modeling

CS Modeling Coordinates (called MC) are. –...3D right-handed device-independent coordinates –... specified by a homogeneous transformation matrix When modeling transformations are not inserted into a structure... –...modeling coordinates are the same as world coordinates Overview of 2D & 3D Pipelines Modeling

CS D transformations are represented by 3X3 matrices using homogeneous coordinates... 3D transformations are represented by 4x4 matrices using homogeneous coordinates in 3-space Mastering 2D & 3D Graphics Coordinate Spaces

CS What are homogeneous coordinates? Well...instead of representing a point as (x,y,z)... –...we represent it as (x,y,z,W)...but we most commonly refer to it as (x/W, y/W, z/W, 1) When we transform a point to this form... –...it is called homogenizing Mastering 2D & 3D Graphics Coordinate Spaces: homogeneous coordinates

CS This means...that each point in 3-space is represented by a line through the origin in 4-space! So...homogenizing allows us to use points that form a 3D subspace of 4-space (i.e., W=1) Mastering 2D & 3D Graphics Coordinate Spaces: homogeneous coordinates

CS Most graphics systems use the right-handed coordinate system for the definition of objects In right-handed systems... –...positive rotations occur when looking from the positive axis to the origin –...a 90˚ counterclockwise rotation will transform one positive axis into the other Mastering 2D & 3D Graphics Coordinate Spaces: right-handed

CS For example, to rotate around the x axis......the positive rotation is from y to z Or, to rotate around the y axis... –...the positive rotation is from z to x And lastly, to rotate around the z axis... –...the positive rotation is from x to y Mastering 2D & 3D Graphics Coordinate Spaces: right-handed

CS Some graphics systems use the left-handed coordinate system for viewing objects... –Left-handed systems may seem more natural......as larger z values appear further from the operator In left-handed systems... –...positive rotations occur when looking from the positive axis to the origin –...a 90˚ clockwise rotation will transform one positive axis into the other Mastering 2D & 3D Graphics Coordinate Spaces: left-handed

CS Z X Y Right-Handed Z X Y Left-Handed Z is coming out of the display towards you Z is heading into the display (or away from you) Mastering 2D & 3D Graphics Coordinate Spaces

CS A set of vertices or 3D points belonging to an object... –...can be transformed into another set of points...using linear transformations Mastering 2D & 3D Graphics Linear Transformations

CS Translation: [x' y' z' 1] = [x y z 1] Tx Ty Tz 1 Translation means... –x' = x + Txy' = y + Tyz' = z + Tz Mastering 2D & 3D Graphics Linear Transformations

CS Scaling: Sx, Sy, and Sz are scaling factors Sx [x' y' z' 1] = [x y z 1] 0 Sy Sz When Sx = Sy = Sz, there is uniform scaling... –...otherwise scaling occurs only along the axes specified x' = xSxy' = ySyz' = zSz Mastering 2D & 3D Graphics Linear Transformations

CS To rotate an object in three-dimensional space, an axis of rotation must be specified... –...it is best to use one of the coordinate axes Counterclockwise rotation about each of the axes uses (around X, Y, Z respectively) cos˚ 0 -sin˚ 0 cos˚ sin˚ cos˚ sin˚ sin˚ cos˚ sin˚ cos˚ 0 sin˚ 0 cos˚ Mastering 2D & 3D Graphics Linear Transformations

CS Around the Z axis, this means: –x' = xcos˚-ysin˚ –y' = xsin˚+ycos˚ –z' = z Mastering 2D & 3D Graphics Linear Transformations

CS When objects are not at the origin... –...a simple rotation will not rotate the object in place Instead, we must... –...first translate the object to the origin, –...apply the desired rotation, and –...translate the object back to its original position Mastering 2D & 3D Graphics Linear Transformations

CS This means for a rotation around the Z axis (when the Z axis passes through the point (Tx, Ty, 0))... –x' = xcos˚ - ysin˚ - Txcos˚ + Tysin˚ + Tx –y' = xsin˚ + ycos˚ - Txsin˚ - Tycos˚ + Ty –z' = z Mastering 2D & 3D Graphics Linear Transformations

CS Useful in describing objects that have a natural hierarchy For example, a stylization of a human figure used in animation would... –...have a set of local coordinate systems based on limb joints –...describe a hierarchy based on these joints –...allow the hand to move with respect to the wrist joint and the lower arm to move with respect to the elbow joint Mastering 2D & 3D Graphics Concatenating Transformations

CS With Preconcatenate... –...the specified transformation is applied to the object first –...if you preconcatenate a rotation, that rotation will be applied to the object before the other transformations Current xform x New (L'=LxM) Modeling Transformations Composition: Concatenating Xforms

CS With Postconcatenate... –...the specified transformation is applied to the object after the current existing local transformation New x Current Xform (L'=MxL) Modeling Transformations Composition: Concatenating Xforms

CS Inheritance of modeling transformations means... –...a parent's composite modeling transformation becomes the initial child's global modeling transformation –...a child's initial local modeling transformation is the identity matrix –...descendant structures do not affect parent structures Modeling Transformations Composition: Inheritance

CS Modifications... –to the global transformation only have effect within the structure in which they are encountered –This allows structure hierarchies to be built with movable parts... –...since the motion of the parent structure is passed to its children via inheritance of the composite modeling transformation, the parts are kept connected Modeling Transformations Composition: Inheritance

CS Inheritance... A B C D E F H I Initial identity local & global transformations When B, D, or F are called, these transformations are saved When control is returned to A, these transformations are restored When B is called, A's composite transformation becomes B's global transformation B's initial local transformation is identity When D, C, or E are called, these transformations are saved When control is returned to B, these transformations are restored

CS View orientation transformation... –...defines the position and orientation of view reference coordinates relative to world coordinates 2D Viewing Transformations View Orientation Transformation Y X V U View Reference Point View Up Vector

CS View mapping transformation... –...defines the mapping of view reference coordinates to normalized projection coordinates, allowing for distortion... 2D Viewing Transformations View Mapping Transformation (0,0) (0,1) (1,0) View Window in VRCs Projection Viewport in NPCs

CS Allows dynamic horizontal and vertical panning... –...by continuously adding to both sides of the view window, or –...by changing the view reference point and leaving the view window unchanged Remember, panning is achieved by changing the window location! 2D Viewing Transformations View Mapping Transformation

CS D Viewing Transformations View Mapping Transformation

CS Allows dynamic zooming... –...by continuously changing the view window by a uniform percentage in the horizontal and vertical directions 2D Viewing Transformations View Mapping Transformation

CS Allows dynamic rotation... –...by continuously changing the view up vector –The effect is as if you were rotating a camera used to view your picture 2D Viewing Transformations View Mapping Transformation

CS Overview of 2D & 3D Pipelines 3D Viewing & Clipping Three operations are associated with 3D viewing... –...view orientation –...view mapping...XYZ clipping View orientation... –...maps world coordinates to view reference coordinates –...transforms and defines the position and orientation of the VRCs relative to world coordinates

CS Overview of 2D & 3D Pipelines 3D Viewing & Clipping View mapping... –...maps view reference coordinates to normalized projection coordinates...specifies a 3D volume of VRC to be mapped to a 3D volume of NPC (a unit cube extending from 0.0 to 1.0 in X,Y,Z) XYZ clipping... –...is performed on the XY boundary (or clip rectangle), and front and back planes

CS Overview of 2D & 3D Pipelines Rendering Is the general process for changing a 2D or 3D graphic object to a shaded 2D projection onto a drawing surface Rendering involves... –...setting up data structures for polygon mesh models to ensure that they will contain all of the information required in the shading process

CS Overview of 2D & 3D Pipelines Rendering Rendering also involves... –...setting up data structures for polygon mesh models to ensure that they will contain all of the information required in the shading process –...culling back-facing polygons (3D Only) –...applying a hidden surface removal algorithm(3D Only)...scan converting or rasterizing polygons: converting an object's vertices into a set of pixel coordinates & shading

CS Overview of 2D & 3D Pipelines Example: 2D graphic object pipeline Viewing and Rendering