Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Animation Process while (not finished) { MoveEverything();

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Homogeneous Transformations CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Principles of Computer-Aided Design and Manufacturing Second Edition 2004 ISBN Author: Prof. Farid. Amirouche University of Illinois-Chicago.
Computer Graphics Lecture 4 Geometry & Transformations.
Links and Joints.
Computer Animation CSE169: Computer Animation
General Physics (PHYS101)
Lecture 2: linear algebra, animation basics
Chapter 11 Angular Momentum.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Computer Animation CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Intro to Simulation and Virtual Reality CE Animation v Simulation Week 3.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Computer Graphics CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006.
Vectors & Matrices CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
An Introduction to Robot Kinematics
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.
2IV60 Computer Graphics Basic Math for CG
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Mathematical Fundamentals
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Vectors & Matrices CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Chapter 4.1 Mathematical Concepts
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformation of Graphics
Inverse Kinematics.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
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
Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Rigging.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
KINEMATIC CHAINS & ROBOTS (I).
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
CGDD 4003 THE MATH LECTURE (BOILED DOWN, YET LIGHTLY SALTED)
What is Kinematics. Kinematics studies the motion of bodies.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Chapter 11 Angular Momentum. Angular momentum plays a key role in rotational dynamics. There is a principle of conservation of angular momentum.  In.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Computer Graphics I, Fall 2010 Transformations.
Animation Animation is about bringing things to life Technically: –Generate a sequence of images that, when played one after the other, make things move.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
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.
Lecture 03: Linear Algebra
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Computer Graphics Lecture 15.
Game Programming Algorithms and Techniques
Presentation transcript:

Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Animation Process while (not finished) { MoveEverything(); DrawEverything(); } Interactive vs. Non-Interactive Real Time vs. Non-Real Time

Multimedia System and Networking UTD Slide- 2 University of Texas at Dallas B. Prabhakaran Character Rigging Skeleton Skin Facial Expressions Muscles Secondary motion: fat, hair, clothing…

Multimedia System and Networking UTD Slide- 3 University of Texas at Dallas B. Prabhakaran Character Animation Keyframe Animation Motion Capture Inverse Kinematics Locomotion Procedural Animation Artificial Intelligence

Multimedia System and Networking UTD Slide- 4 University of Texas at Dallas B. Prabhakaran Character Animation

Multimedia System and Networking UTD Slide- 5 University of Texas at Dallas B. Prabhakaran Physics Simulation Particles Rigid bodies –Collisions, contact, stacking, rolling, sliding Articulated bodies –Hinges, constraints Deformable bodies (solid mechanics) –Elasticity, plasticity, viscosity –Fracture –Cloth Fluid dynamics –Fluid flow (liquids & gasses) –Combustion (fire, smoke, explosions…) –Phase changes (melting, freezing, boiling…) Vehicle dynamics –Cars, boats, airplanes, helicopters, motorcycles… Character dynamics –Body motion, skin & muscle, hair, clothing

Multimedia System and Networking UTD Slide- 6 University of Texas at Dallas B. Prabhakaran Physics Simulation

Multimedia System and Networking UTD Slide- 7 University of Texas at Dallas B. Prabhakaran Animation Tools Maya 3D Studio Lightwave Filmbox Blender Many more…

Multimedia System and Networking UTD Slide- 8 University of Texas at Dallas B. Prabhakaran Animation Production Conceptual Design Production Design Modeling Materials & Shaders Rigging Blocking Animation Lighting Effects Rendering Post-Production

Multimedia System and Networking UTD Slide- 9 University of Texas at Dallas B. Prabhakaran Resolution & Frame Rates Video: –NTSC: 720 x 30 Hz (interlaced) –PAL: 720 x 25 Hz (interlaced) HDTV: –720p: 1280 x 60 Hz –1080i: 1920 x 30 Hz (interlaced) –1080p: 1920 x 60 Hz Film: –35mm: ~2000 x 24 Hz –70mm: ~4000 x 24 Hz –IMAX: ~5000 x Hz Note: Hz (Hertz) = frames per second (fps) Note: Video standards with an i (such as 1080i) are interlaced, while standards with a p (1080p) are progressive scan

Multimedia System and Networking UTD Slide- 10 University of Texas at Dallas B. Prabhakaran Interlacing Older video formats (NTSC, PAL) and some HD formats (1080i) use a technique called interlacing With this technique, the image is actually displayed twice, once showing the odd scanlines, and once showing the even scanlines (slightly offset) This is a trick for achieving higher vertical resolution at the expense of frame rate (cuts effective frame rate in half) The two different displayed images are called fields NTSC video, for example, is 720 x 480 at 30 frames per second, but is really 720 x 240 at 60 fields per second Interlacing is an important issue to consider when working with video, especially in animation as in TV effects and video games Computer monitors are generally not interlaced

Multimedia System and Networking UTD Slide- 11 University of Texas at Dallas B. Prabhakaran Rendering There are many ways to design a 3D renderer The two most common approaches are: –Traditional graphics pipeline –Ray-based rendering With the traditional approach, primitives (usually triangles) are rendered into the image one at a time, and complex visual effects often involve a variety of different tricks With ray-based approaches, the entire scene is stored and then rendered one pixel at a time. Ray based approaches can simulate light more accurately and offer the possibility of significant quality improvements, but with a large cost In this class, we will not be very concerned with rendering, as we will focus mainly on how objects move rather than how they look

Multimedia System and Networking UTD Slide- 12 University of Texas at Dallas B. Prabhakaran Coordinate Systems Right handed coordinate system

Multimedia System and Networking UTD Slide- 13 University of Texas at Dallas B. Prabhakaran 3D Models Let’s say we have a 3D model that has an array of position vectors describing its shape We will group all of the position vectors used to store the data in the model into a single array: v n where 0 ≤ n ≤ NumVerts-1 Each vector v n has components v nx v ny v nz

Multimedia System and Networking UTD Slide- 14 University of Texas at Dallas B. Prabhakaran Vector Review

Multimedia System and Networking UTD Slide- 15 University of Texas at Dallas B. Prabhakaran Vector Arithmetic

Multimedia System and Networking UTD Slide- 16 University of Texas at Dallas B. Prabhakaran Vector Magnitude The magnitude (length) of a vector is: A vector with length=1.0 is called a unit vector We can also normalize a vector to make it a unit vector:

Multimedia System and Networking UTD Slide- 17 University of Texas at Dallas B. Prabhakaran Dot Product

Multimedia System and Networking UTD Slide- 18 University of Texas at Dallas B. Prabhakaran Dot Product

Multimedia System and Networking UTD Slide- 19 University of Texas at Dallas B. Prabhakaran Example: Angle Between Vectors How do you find the angle θ between vectors a and b? a b θ

Multimedia System and Networking UTD Slide- 20 University of Texas at Dallas B. Prabhakaran Example: Angle Between Vectors a b θ

Multimedia System and Networking UTD Slide- 21 University of Texas at Dallas B. Prabhakaran Dot Products with General Vectors The dot product is a scalar value that tells us something about the relationship between two vectors –If a·b > 0 then θ < 90º –If a·b 90º –If a·b = 0 then θ = 90º (or one or more of the vectors is degenerate (0,0,0))

Multimedia System and Networking UTD Slide- 22 University of Texas at Dallas B. Prabhakaran Dot Products with One Unit Vector a u a·u If |u|=1.0 then a·u is the length of the projection of a onto u

Multimedia System and Networking UTD Slide- 23 University of Texas at Dallas B. Prabhakaran Example: Distance to Plane A plane is described by a point p on the plane and a unit normal n. Find the distance from point x to the plane p n x

Multimedia System and Networking UTD Slide- 24 University of Texas at Dallas B. Prabhakaran Example: Distance to Plane The distance is the length of the projection of x- p onto n: p n x x-p

Multimedia System and Networking UTD Slide- 25 University of Texas at Dallas B. Prabhakaran Dot Products with Unit Vectors b θ a a·b = 0 0 < a·b < 1 a·b = -1 a·b = 1 -1 < a·b < 0 a·b

Multimedia System and Networking UTD Slide- 26 University of Texas at Dallas B. Prabhakaran Cross Product

Multimedia System and Networking UTD Slide- 27 University of Texas at Dallas B. Prabhakaran Properties of the Cross Product area of parallelogram ab is a vector perpendicular to both a and b, in the direction defined by the right hand rule if a and b are parallel

Multimedia System and Networking UTD Slide- 28 University of Texas at Dallas B. Prabhakaran Example: Normal of a Triangle Find the unit length normal of the triangle defined by 3D points a, b, and c a b c

Multimedia System and Networking UTD Slide- 29 University of Texas at Dallas B. Prabhakaran Example: Normal of a Triangle b-a c-a a b c

Multimedia System and Networking UTD Slide- 30 University of Texas at Dallas B. Prabhakaran Example: Area of a Triangle Find the area of the triangle defined by 3D points a, b, and c a b c

Multimedia System and Networking UTD Slide- 31 University of Texas at Dallas B. Prabhakaran Example: Area of a Triangle b-a c-a a b c

Multimedia System and Networking UTD Slide- 32 University of Texas at Dallas B. Prabhakaran Example: Alignment to Target An object is at position p with a unit length heading of h. We want to rotate it so that the heading is facing some target t. Find a unit axis a and an angle θ to rotate around. p h t

Multimedia System and Networking UTD Slide- 33 University of Texas at Dallas B. Prabhakaran Example: Alignment to Target p h t t-p θ a

Multimedia System and Networking UTD Slide- 34 University of Texas at Dallas B. Prabhakaran Vector Class class Vector3 { public: Vector3(){x=0.0f; y=0.0f; z=0.0f;} Vector3(float x0,float y0,float z0){x=x0; y=y0; z=z0;} void Set(float x0,float y0,float z0){x=x0; y=y0; z=z0;} void Add(Vector3 &a){x+=a.x; y+=a.y; z+=a.z;} void Add(Vector3 &a,Vector3 &b){x=a.x+b.x; y=a.y+b.y; z=a.z+b.z;} void Subtract(Vector3 &a){x-=a.x; y-=a.y; z-=a.z;} void Subtract(Vector3 &a,Vector3 &b){x=a.x-b.x; y=a.y-b.y; z=a.z-b.z;} void Negate(){x=-x; y=-y; z=-z;} void Negate(Vector3 &a){x=-a.x; y=-a.y; z=-a.z;} void Scale(float s){x*=s; y*=s; z*=s;} void Scale(float s,Vector3 &a){x=s*a.x; y=s*a.y; z=s*a.z;} float Dot(Vector3 &a){return x*a.x+y*a.y+z*a.z;} void Cross(Vector3 &a,Vector3 &b) {x=a.y*b.z-a.z*b.y; y=a.z*b.x-a.x*b.z; z=a.x*b.y-a.y*b.x;} float Magnitude(){return sqrtf(x*x+y*y+z*z);} void Normalize(){Scale(1.0f/Magnitude());} float x,y,z; };

Multimedia System and Networking UTD Slide- 35 University of Texas at Dallas B. Prabhakaran Translation Let’s say that we want to move our 3D model from it’s current location to somewhere else… In technical jargon, we call this a translation We want to compute a new array of positions v′ n representing the new location Let’s say that vector d represents the relative offset that we want to move our object by We can simply use: v′ n = v n + d to get the new array of positions

Multimedia System and Networking UTD Slide- 36 University of Texas at Dallas B. Prabhakaran Transformations v′ n = v n + d This translation represents a very simple example of an object transformation The result is that the entire object gets moved or translated by d From now on, we will drop the n subscript, and just write v′ = v + d remembering that in practice, this is actually a loop over several different v n vectors applying the same vector d every time

Multimedia System and Networking UTD Slide- 37 University of Texas at Dallas B. Prabhakaran Transformations Always remember that this compact equation can be expanded out into Or into a system of linear equations:

Multimedia System and Networking UTD Slide- 38 University of Texas at Dallas B. Prabhakaran Rotation Now, let’s rotate the object in the xy plane by an angle θ, as if we were spinning it around the z axis Note: a positive rotation will rotate the object counterclockwise when the rotation axis (z) is pointing towards the observer

Multimedia System and Networking UTD Slide- 39 University of Texas at Dallas B. Prabhakaran We can expand this to: And rewrite it as a matrix equation: Or just: Rotation

Multimedia System and Networking UTD Slide- 40 University of Texas at Dallas B. Prabhakaran Rotation We can represent a z-axis rotation transformation in matrix form as: or more compactly as: where

Multimedia System and Networking UTD Slide- 41 University of Texas at Dallas B. Prabhakaran Rotation We can also define rotation matrices for the x, y, and z axes:

Multimedia System and Networking UTD Slide- 42 University of Texas at Dallas B. Prabhakaran Linear Transformations Like translation, rotation is an example of a linear transformation True, the rotation contains sin()’s and cos()’s, but those ultimately just end up as constants in the actual linear equation We can generalize our matrix in the previous example to be:

Multimedia System and Networking UTD Slide- 43 University of Texas at Dallas B. Prabhakaran Linear Equation A general linear equation of 1 variable is: where a and d are constants A general linear equation of 3 variables is: Note: there are no nonlinear terms like v x v y, v x 2, sin(v x )…

Multimedia System and Networking UTD Slide- 44 University of Texas at Dallas B. Prabhakaran System of Linear Equations Now let’s look at 3 linear equations of 3 variables v x, v y, and v z Note that all of the a n, b n, c n, and d n are constants (12 in total)

Multimedia System and Networking UTD Slide- 45 University of Texas at Dallas B. Prabhakaran Matrix Notation

Multimedia System and Networking UTD Slide- 46 University of Texas at Dallas B. Prabhakaran Translation Let’s look at our translation transformation again: If we really wanted to, we could rewrite our three translation equations as:

Multimedia System and Networking UTD Slide- 47 University of Texas at Dallas B. Prabhakaran Identity We can see that this is equal to a transformation by the identity matrix

Multimedia System and Networking UTD Slide- 48 University of Texas at Dallas B. Prabhakaran Identity Multiplication by the identity matrix does not affect the vector

Multimedia System and Networking UTD Slide- 49 University of Texas at Dallas B. Prabhakaran We can apply a uniform scale to our object with the following transformation If s>1, then the object will grow by a factor of s in each dimension If 0<s<1, the object will shrink If s<0, the object will be reflected across all three dimensions, leading to an object that is ‘inside out’ Uniform Scaling

Multimedia System and Networking UTD Slide- 50 University of Texas at Dallas B. Prabhakaran We can also do a more general nonuniform scale, where each dimension has its own scale factor which leads to the equations: Non-Uniform Scaling

Multimedia System and Networking UTD Slide- 51 University of Texas at Dallas B. Prabhakaran Multiple Transformations If we have a vector v, and an x-axis rotation matrix R x, we can generate a rotated vector v′: If we wanted to then rotate that vector around the y- axis, we could simply:

Multimedia System and Networking UTD Slide- 52 University of Texas at Dallas B. Prabhakaran We can extend this to the concept of applying any sequence of transformations: Because matrix algebra obeys the associative law, we can regroup this as: This allows us to concatenate them into a single matrix: Note: matrices do NOT obey the commutative law, so the order of multiplications is important Multiple Transformations

Multimedia System and Networking UTD Slide- 53 University of Texas at Dallas B. Prabhakaran Matrix Dot Matrix

Multimedia System and Networking UTD Slide- 54 University of Texas at Dallas B. Prabhakaran Multiple Rotations & Scales We can combine a sequence of rotations and scales into a single matrix For example, we can combine a y-rotation, followed by a z-rotation, then a non-uniform scale, and finally an x- rotation:

Multimedia System and Networking UTD Slide- 55 University of Texas at Dallas B. Prabhakaran Multiple Translations We can also take advantage of the associative property of vector addition to combine a sequence of translations For example, a translation along vector t 1 followed by a translation along t 2 and finally t 3 can be combined: