csc 202 i ntro. t o c omputer animation techniques and mathematical algorithms by uzoma james...
TRANSCRIPT
CSC 202 INTRO. TO COMPUTER ANIMATIONTechniques and mathematical algorithms
By Uzoma James Chikwem
SALARY OF MATHEMATICIANS
The power of Problem Solving
MATH IN COMPUTER ANIMATION
Math is used to perform many Animation Techniques Perception of Vision Character Position & Effects Object Motion Texture Mapping
Mathematical Algorithms Transformatoions Vectors Matrices Curved surfaces Polygons
TECHNICAL BACKGROUND(ALGORITHMS)
Section will cover: Basics of computer graphic
display pipeline Coordinate spaces or
systems Transformations Perspective
Mathematical Algorithms 2D Space 3D Space Matrices Polygons Curves
DISPLAY PIPELINE Refers to an object created in it’s
own defined space going through transformations to be displayed on screen.
Object space is where an object is originally defined.
World space is where the object can be viewed, or environment.
Eye Space simply relates to what the camera or viewer sees, which is transformed into image space.
Lastly the data is translated, rotated, and scaled into the screen space, or pixels.
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
Point(x,y) MOVED by amount Dx, Dy to new location (x’,y’)
Point (x,y) enlarges, shrinks, reflects to new location (x’,y’)
TRANSLATION IN 2D SCALING IN 2D
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
Scales an object inversely usually by multiplying by a negative scalar.
Flips an object off a point, line or plane
Very useful to know when modeling in 3D as well as animating in 2D
REFLECTION IN 2D
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
REFLECTION IN 2D
•These rules should help in calculating new location.
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
Rotates Point(x,y) about the origin of the scene, not object.
Theta represents the angle of change.
To better visualize think of the unit circle used in trig class to help graph sine, cosine and tangent.
ROTATION IN 2D
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
Remember graphing these in Precalc?
Now you get to visualize them and how each angle is used to animate rotation.
Remember these angles and their coordinates to help better understand.
ROTATION IN 2D
TRANSFORMATIONS, OR CHANGE, IN COORDINATES OVER TIME CREATES ANIMATION
ROTATION IN 2D
2D COORDINATE SYSTEM
Commonly used to graph algorithms to show Constant motion Acceleration/deceleration No movement
Programming Math Javascript C++ OpenGL Python Plenty more…
for ( i = 0; i <= 1; i += 0.1 ) {x = i;y = i;…}
2D COORDINATE SYSTEM
for ( i = 0; i <= 1; i += 0.1 ) {
x = i; y = i * i;}
for ( i = 0; i <= 1; i += 0.1 ) { x = i; y = Math.pow( i, 4 );}
SINE WAVES FOR SMOOTH ANIMATIONvar counter = 0;// 100 iterationsvar increase = Math.PI / 100;for ( i = 0; i <= 1; i += 0.01 ) {
x = i;y = Math.sin(counter);counter += increase;
}
var counter = 0;// 100 iterationsvar increase = Math.PI *?? / 100;for ( i = 0; i <= 1; i += 0.01 ) { x = i;
y = Math.sin(counter);counter += increase;
}
TRANSFORMATIONS
ROTATION
TRANSLATION
SCALE