Author: Zsófia Ruttkay Version: 1.0 Date: 25.2.2009
Motion is reminiscent of living creatures: animals wonder around, they escape from enemy or chase a prey, and even when they have nothing to do they often perform 'idle' motion - when do we see fully motionless people? Plants move too: growth is a very slow change of form, stems bow, flowers tremble, petals fly away ... Snow flakes dance, clouds develop and move ...
In this section we will set out to generate motion purely by controlling the speed and direction (path) of the motion. We will look at approaches to mimic organic motion, characterised by smoothness, irregularity and often with cycles. And consider behaviour of animals like chasing, searching or escaping. You will see that just by purely defining change of speed and motion path, we can produce illusion of organic motion.
Look at me, follow me - mouse-driven motion
Mouse-driven circle
src: CourseSketches/Mousedriven/Greenberg_11_10/Greenberg_11_10.pde | mouseX, mouseY, fading effect | |
Rotate ladybirds towards mouse
| atan2(diry-y, dirx-x) multiple files for a single sketch | |
Rotate small ladybird towards mouse
src files: CourseSketches/Mousedriven/rotscaleLadybird/ Ladybird approaches mouse src files: CourseSketches/Mousedriven/approachLadybird/ | | |
Eyes looking at the mouse
| atan2(diry-y, dirx-x) multiple files for a single sketch |
Let it rain!
A single rain drop falling
src: CourseSketches/Rains/Rain0/Rain0.pde From of drop changing on mouse click
| switch() wrap around screen | |
Non-vertical rain
src: CourseSketches/Rains/Rain2/Rain2.pde A row of rain drops src: CourseSketches/Rains/Rain3/Rain3.pde A grid of rain drops src: CourseSketches/Rains/Rain4/Rain4.pde | one and two dimensional array | |
Distribution randomized
src: CourseSketches/Rains/Rain5_1/Rain5_1.pde Distribution and length of drops is randomized src: CourseSketches/Rains/Rain5_2/Rain5_2.pde Also initial speed is randomized src: CourseSketches/Rains/Rain5_3/Rain5_3.pde MouseX location controls how heavy it rains src: CourseSketches/Rains/Rain6/Rain6.pde | random() | |
Rings caused by a drop Concentric circles flow out and vanish, on mouse click. src: CourseSketches/Rains/rings_1/rings_1.pde | setting transparency frameCount(), %, | |
Rings caused by a drop Concentric circles flow out and vanish, on mouse click. src: CourseSketches/Rains/rings2/rings2.pde | setting transparency frameCount(), %, |
Changing speed, nonlinear path
Easing out when close to mouse
src: CourseSketches/Speedchange/Mod31_06/Mod31_06.pde Easing out at resting stops towards mouse
| dist() distance proportional easing | |
Sinusoid motion
src: CourseSketches/Speedchange/Mod32_01/Mod32_01.pde Sinusoid motion horizontally - a flower ? | sin(angle)*radius | |
Swaying motion of tails (grass)
Experiment with changing the increment for the angle. src: CourseSketches/Speedchange/Mod32_07/Mod32_07.pde | sin(angle+phase) | |
Pulsing change of shape
Experiment with changing the increment for the angle. src: CourseSketches/Speedchange/Mod32_04/Mod32_04.pde | sin(angle+phase) |
Random motion
Random path and random orientation
src: CourseSketches/Speedchange/Mod32_06/Mod32_06.pde | |
Lines pulsing - with noise
src: CourseSketches/Speedchange/Mod32_08/Mod32_08.pde | |
Random walk 1D
src: CourseSketches/Randomwalks/Randomwalk1D/Randomwalk1D.pde | |
Random walk 2D
src: CourseSketches/Randomwalks/Randomwalk2D/Randomwalk2D.pde | |
Ladybird random walk
src: CourseSketches/Randomwalks/walkLadybird/walkLadybird.pde |
On-line learning resources
Design Programming course slides by Rob Saunders