Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithmic Animation & Particle Systems

Similar presentations


Presentation on theme: "Algorithmic Animation & Particle Systems"— Presentation transcript:

1 Algorithmic Animation & Particle Systems

2 Key Frame Animation Hand-drawn animation was straight-ahead (start at one position, and animate each small movement Computer Animation is usually based on key frames – a frame for the starting position and a frame for the end position

3 Key Frame Animation How do you calculate the frame positions in between key frames? Interpolation: Approximation of a function between two known points

4 Why interpolation? Attributes (position, size, color) change as a function over time Function often given by physics f = ma Why approximate a known function? Solving function at certain point requires solving differential equations

5 Interpolation Idea: Don’t want to solve equation at each point
Approximate some points and connect them with Lines Arcs Other functions (trig)

6 Euler Integration Use first derivative to get the direction of the curve at a point. Draw lines in direction of first derivative Accuracy depends on the frequency with which you re-evaluate the derivative

7 Euler Integration

8 Linear Interpolation Use a line to connect 2 way points In C#:
Mathf.Lerp(from, to, percent) Vector3.Lerp Quaternion.Lerp Color.Lerp

9 Example – Moving between way points
private Vector3 start; private Vector3 end; private float startTime; private float speed; void Start() { startTime = Time.time; } void Update() { float journeyLength = Vector3.Distance(start, end); float distCovered = (Time.time - startTime)* speed; float fracJourney = distCovered / journeyLength; transform.position = Vector3.Lerp(start, end, fracJourney);

10 More on Approximation Collision Detection:
Can’t always calculate every collision Isolate groups of things that may collide Approximate the result

11 Example: Hair

12 Example: Springs Hooke’s law: f = – kx k is “springiness” constant
x is extension Also know f = ma Spring forces act on other elements(& other springs)

13 Particle Systems Create one simple object
Objects follow rules of behavior Many instances of the simple object create an interesting overall effect

14 Examples: Small spheres Fireworks Waterfalls

15 Particle Systems: Springs Hair Cloth

16 Distributed Computation
De-centralized control Aggregate behavior emerges Simple rules for the individual lead to complex behavior for the group Often very natural-looking

17 Distributed Computation Examples
Braitenberg Vehicles Light lover Light fear Aggression Traffic Patterns

18 Distributed Computation Examples
Boids: three rules Separation Alignment Cohesion

19 Distributed Computation Examples
Fish Virtual Fishtank Xiaoyuan Tu

20 Artificial Life Ants Know “home” Look for food
If they find food source, pick it up and head home Drop pheromones – chemicals “smelled” by antennae Result: All food gets taken home

21 Artificial Life Termites Rules Result: food in one place
If you reach food and don’t have any, pick some up If you reach food and have some already, put it down Move randomly Result: food in one place

22 Artificial Life Creatures Random joints with degrees of freedom
Try to move Learn to move from one place to the other


Download ppt "Algorithmic Animation & Particle Systems"

Similar presentations


Ads by Google