(c) 2002 University of Wisconsin, CS 559

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
1 Computer Graphics Chapter 6 2D Transformations.
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
02/14/02(c) University of Wisconsin 2002, CS 559 Last Time Filtering Image size reduction –Take the pixel you need in the output –Map it to the input –Place.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
Mathematical Fundamentals
10/13/200© NTUST Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 2, 3 due Oct 13 in class.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
2D Graphics: Rendering Details
Transformations Jehee Lee Seoul National University.
Geometric Transformations
Filtering and Color To filter a color image, simply filter each of R,G and B separately Re-scaling and truncating are more difficult to implement: –Adjusting.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
2/17/04© University of Wisconsin, CS559 Spring 2004 Last Time Resampling –Ideal reconstruction –You can only ideally reconstruct band-limited functions.
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)
9/30/04© University of Wisconsin, CS559 Fall 2004 Last Time Reconstruction Aliasing Compositing Intro.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
In the name of God Computer Graphics.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Applications and Rendering pipeline
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Computer Graphics 2D Transformations
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
- Introduction - Graphics Pipeline
In the name of God Computer Graphics.
Geometric Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
2D Transformations with Matrices
Review: Transformations
3D Geometric Transformations
Chapter 5 2-D Transformations.
Computer Graphics Transformations.
3D Transformations Source & Courtesy: University of Wisconsin,
Review: Transformations
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 Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Line and Character Attributes 2-D Transformation
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
© University of Wisconsin, CS559 Spring 2004
© University of Wisconsin, CS559 Fall 2004
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
© University of Wisconsin, CS559 Spring 2004
(c) University of Wisconsin, CS559
Geometric Objects and Transformations (II)
CS-378: Game Technology Lecture #4: Texture and Other Maps
CSCE441: Computer Graphics 2D/3D Transformations
Image manipulation via matrices
Lecture 8: 3D Transforms Li Zhang Spring 2008
Last Time Dithering Introduction to signal processing Filtering
TWO DIMENSIONAL TRANSFORMATION
Presentation transcript:

(c) 2002 University of Wisconsin, CS 559 Last Time The end of Sampling and Filtering Compositing 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Today Compositing Summary Intro to 3D (and 2D) Graphics Homework 2 due 10/1/02 (c) 2002 University of Wisconsin, CS 559

Compositing Operations F and G describe how much of each input image survives, and cf and cg are pre-multiplied pixels, and all four channels are calculated Operation F G Over Inside Outside Atop Xor Clear Set 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Unary Operators Darken: Makes an image darker (or lighter) without affecting its opacity Dissolve: Makes an image transparent without affecting its color 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 “PLUS” Operator Computes composite by simply adding f and g, with no overlap rules Useful for defining cross-dissolve in terms of compositing: 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Obtaining  Values Hand generate (paint a grayscale image) Automatically create by segmenting an image into foreground background: Blue-screening is the analog method Remarkably complex to get right “Lasso” is the Photoshop operation With synthetic imagery, use a special background color that does not occur in the foreground Brightest blue or green is common 10/1/02 (c) 2002 University of Wisconsin, CS 559

Compositing With Depth Can store pixel “depth” instead of alpha Then, compositing can truly take into account foreground and background Generally only possible with synthetic imagery Image Based Rendering is an area of graphics that, in part, tries to composite photographs taking into account depth 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Where to now… We are now done with images We will spend several weeks on the mechanics of 3D graphics Coordinate systems and Viewing Clipping Drawing lines and polygons Lighting and shading We will finish the semester with modeling and some additional topics 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Graphics Toolkits Graphics toolkits typically take care of the details of producing images from geometry Input (via API functions): Where the objects are located and what they look like Where the camera is and how it behaves Parameters for controlling the rendering Functions (via API): Perform well defined operations based on the input environment Output: Pixel data in a framebuffer – an image in a special part of memory Data can be put on the screen Data can be read back for processing (part of toolkit) 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 OpenGL OpenGL is an open standard graphics toolkit Derived from SGI’s GL toolkit Provides a range of functions for modeling, rendering and manipulating the framebuffer What makes a good toolkit? Alternatives: Direct3D, Java3D - more complex and less well supported 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Coordinate Systems The use of coordinate systems is fundamental to computer graphics Coordinate systems are used to describe the locations of points in space Multiple coordinate systems make graphics algorithms easier to understand and implement 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Coordinate Systems (2) Different coordinate systems represent the same point in different ways Some operations are easier in one coordinate system than in another We saw this in filtering: It’s easier to define the filter in one space, but transform it to another for use (2,3) (1,2) v v y y u u x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Transformations Transformations convert points between coordinate systems (2,3) u=x-1 v=y-1 (1,2) v v y y u x=u+1 y=v+1 u x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

Transformations (Alternate Interpretation) Transformations modify an object’s shape and location in one coordinate system The previous interpretation is better for some problems, this one is better for others (2,3) x’=x-1 y’=y-1 y y (1,2) x=x’+1 y=y’+1 x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

2D Affine Transformations An affine transformation is one that can be written in the form: 10/1/02 (c) 2002 University of Wisconsin, CS 559

Why Affine Transformations? Affine transformations are linear Transforming all the individual points on a line gives the same set of points as transforming the endpoints and joining them Interpolation is the same in either space: Find the halfway point in one space, and transform it. Will get the same result if the endpoints are transformed and then find the halfway point 10/1/02 (c) 2002 University of Wisconsin, CS 559

Composition of Affine Transforms Any affine transformation can be composed as a sequence of simple transformations: Translation Scaling (possibly with negative values) Rotation See Shirley 1.3.6 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Translation Moves an object y y by x bx x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Translation Moves an object y y by x bx x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Scaling Resizes an object in each dimension y y syy y x x sxx x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Scaling Resizes an object in each dimension y y syy y x x sxx x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Rotation Rotate counter-clockwise about the origin by an angle  y y  x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 2D Rotation Rotate counter-clockwise about the origin by an angle  y y  x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 X-Axis Shear Shear along x axis (What is the matrix for y axis shear?) y y x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 X-Axis Shear Shear along x axis (What is the matrix for y axis shear?) y y x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Reflect About X Axis x x What is the matrix for reflect about Y axis? 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 Reflect About X Axis x x What is the matrix for reflect about Y axis? 10/1/02 (c) 2002 University of Wisconsin, CS 559

Rotating About An Arbitrary Point What happens when you apply a rotation transformation to an object that is not at the origin? y ? x 10/1/02 (c) 2002 University of Wisconsin, CS 559

Rotating About An Arbitrary Point What happens when you apply a rotation transformation to an object that is not at the origin? It translates as well y x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

(c) 2002 University of Wisconsin, CS 559 How Do We Fix it? How do we rotate an about an arbitrary point? Hint: we know how to rotate about the origin of a coordinate system 10/1/02 (c) 2002 University of Wisconsin, CS 559

Rotating About An Arbitrary Point x x y y x x 10/1/02 (c) 2002 University of Wisconsin, CS 559

Rotate About Arbitrary Point Say you wish to rotate about the point (a,b) You know how to rotate about (0,0) Translate so that (a,b) is at (0,0) x’=x–a, y’=y–b Rotate x”=(x-a)cos-(y-b)sin, y”=(x-a)sin+(y-b)cos Translate back again xf=x”+a, yf=y”+b 10/1/02 (c) 2002 University of Wisconsin, CS 559

Scaling an Object not at the Origin What also happens if you apply the scaling transformation to an object not at the origin? Based on the rotating about a point composition, what should you do to resize an object about its own center? 10/1/02 (c) 2002 University of Wisconsin, CS 559

Back to Rotation About a Pt Say R is the rotation matrix to apply, and p is the point about which to rotate Translation to Origin: Rotation: Translate back: The translation component of the composite transformation involves the rotation matrix. What a mess! 10/1/02 (c) 2002 University of Wisconsin, CS 559

Homogeneous Coordinates Use three numbers to represent a point (x,y)=(wx,wy,w) for any constant w0 Typically, (x,y) becomes (x,y,1) Translation can now be done with matrix multiplication! 10/1/02 (c) 2002 University of Wisconsin, CS 559

Basic Transformations Translation: Rotation: Scaling: 10/1/02 (c) 2002 University of Wisconsin, CS 559

Homogeneous Transform Advantages Unified view of transformation as matrix multiplication Easier in hardware and software To compose transformations, simply multiply matrices Order matters: AB is generally not the same as BA Allows for non-affine transformations: Perspective projections! Bends, tapers, many others 10/1/02 (c) 2002 University of Wisconsin, CS 559