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.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Points, Vectors, Lines, Spheres and Matrices
Three Dimensional Modeling Transformations
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Now Playing: My Mathematical Mind Spoon From Gimme Fiction Released May 10, 2005.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Introduction to 3D Computer Graphics and Virtual Reality McConnell text.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
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.
Chapter 4.1 Mathematical Concepts
COMP 175: Computer Graphics March 24, 2015
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
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.
Camera Geometry and Calibration Thanks to Martial Hebert.
Transformations Dr. Amy Zhang.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Computer Graphics Matrices
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
 An image is the new figure, and the preimage is the original figure  Transformations-move or change a figure in some way to produce an image.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Computer Graphics I, Fall 2010 Transformations.
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
Math Fundamentals Maths revisit.
Chapter 7 Matrix Mathematics
Computer Graphics CC416 Week 15 3D Graphics.
Review: Transformations
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Rendering – Matrix Transformations and the Graphics Pipeline
Linear Algebra A gentle introduction
Game Programming Algorithms and Techniques
Presentation transcript:

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. Matrix operations: addition, scalar multiplication, multiplication (nxm can be multiplied by an mxr to produce an nxr), transpose Examples

Matrix Multiplication When multiplying matrices, the elements of the rows in the first matrix are multiplied with corresponding columns in the second matrix. For two matrices (where necessarily the number of columns in A equals the number of rows in B equals m) the matrix product AB is defined by where C ij =a i1 b 1j + a i2 b 2j +…+ a im b mj

Matrix Multiplication - example Wolfram.com

Matrix Multiplication - properties Associative, distributive, not necessarily commutative Square matrices may have inverses to give an identity matrix; determinants Recall that the cross-product gives a vector that is perpendicular to both

Transformations Kinds of transformations: translation, scaling, rotating May have combinations: order is important Will start by looking at pixel by pixel movement: where does a particular pixel go Each transformation will be a matrix that is 4x4 and the pixel will be a 4x1 matrix (vector) The pixel will be represented by [x y z 1] T homogeneous coordinates – can divide by last coordinate if not 1 Can multiply matrices together to get the complete transformation: (RTSR 1 )v

Translations What matrix would be needed to translate? Start with a 3x4: remember you just want to adjust the x-coordinate by an increment Same with y and z w-coordinate want to leave alone- so fill in the last line See if you can derive the 4x4 matrix

Scaling Try same system with scaling: want to multiply each of the coordinates by a quantity See if you can derive the 4x matrix What happens if you want to scale with respect to the object’s coordinate system? Translate to the origin, scale and then translate back.

Rotations around the axes Consider positive angles to be towards the positive y-axis; in Processing this will be clockwise and in Virtools it will be counterclockwise Consider rotation with respect to one of the world coordinate axes Will get 3 possibilities

Combinations of transformations Have translations, scaling, rotations Can multiply all the transformations together to get a single 4x4 transformation matrix: the order of the multiplications is extremely important; operations are performed in order from right to left Note that inverses of translations are the inverse matrices, as are scalars and rotations (in the opposite direction)

Transformations in Processing The push() and pop() functions will preserve these matrices

Projections 3D worlds are projected on a 2D computer screen If the objects are to be projected with no change in size (near and far objects of the same size will have the same projections) it is called a parallel or orthographic projection- the projection lines are parallel to the axes If the projection plane is z=0 then have If have the projection plane z=d then

Perspective Projections If want a perspective projection then the size of objects will change Viewpoint converges at the eye of the person, plane can be at z=d Then the z distance should be d and the x and y distances should be proportional to (multiplied by) the ratio of d/z (look at similar triangles) This presents a problem for the 4x4 matrix since the form only allows linear combinations of x,y,z This is where the homogeneous coordinates come in: recall that if the w coordinate is not 1 and is not 0, then divide all the coordinates by w to normalize

Perspective Matrices Perspective projections are a reason for homogeneous coordinates Try the multiplication to see that it works- the new point will be [x*d/z, y*d/z, d,1] T

Building and Displaying Objects Points, line segments, planes, planar patches, convex polygons: all specified through points 3D objects built from these primitives: even curved surfaces and lines Need to store these objects efficiently (descriptions that are not pixel by pixel) Need to render these objects every frame: fast algorithms that are accurate and have the right level of detail- scan conversion decides which pixels to render

Line Segments Parametric form for line segment from P 0 to P 1 : L(t)=(1 – t) P 0 + tP 1 where

Planes Plane is determined uniquely by 3 non linear points- equivalently 2 vectors Equation for a plane is Ax+By+Cz+D=0 where the constants are not all 0 (A,B,C) are the components of a normal vector Can start with 3 points, form two vectors, find the normal vector (calculate the cross product) and then use one of the points to solve for D.

Spheres Need the center and a radius; if radius at origin then have r 2 = x 2 + y 2 + z 2 Could go around the edge of a circle with x and y and solve for z: computationally expensive because involve lots of multiplications and square roots- these cost more than additions and subtractions Algorithm to make this more efficient

Convex Polygons Convex polygons: line segments joining points of the polygon are within the polygon If have more than 3 points may not have a unique polygon Safe thing is to have convex polygons triangulated Polygons defined by meshes: order of points is important because it defines the normal: counterclockwise rule (wrap hand in order of points and then the thumb points toward the normal) Data storage of triangles: list of vertices, indices for faces

Level of Detail If objects are far away then there is no need for them to have thousands of rectangles or intricate lighting Objects may have different models depending on how close the camera is to the object: for the farthest away there might only be one face with a color or blurry texture In Virtools can specify LOD

Scene Hierarchy or Scene Graphs Have levels and parent/child relationships At the very top is the Universe (called Level in Virtools) Hierarchy gives rise to dependent coordinate systems and types of movement where children tag along with the parent