SWINGING IPOD SIMULATION

Donna Samuel

CMPS 161 Visualization and Animation Winter 2010

Text Box: Atom
•	Float Mass
•	Vector3D position
•	Vector3D vel
•	Vector3D force
•	Float k_sticky
•	Float k_friction
•	Float k_absorption 
•	Float air_friction
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 

 

 


Reserved: The Ipod is hanging loosely on itself. Currently, all forces are acting on it.

 

 

 

Reserved: The ipod swings as an input force by user is being applied.

 

 

 

 

Reserved: Swing to the other side!

 

 

 

Reserved: Ipod being dragged along the ground

 

 

 

 

What went wrong….

Initially, my idea was to implement the Hooke’s Law of Spring Force. This involves another method of calculation and involves another coefficient called the damping coefficient.  However, when I implemented this model, the body of the rope became too rigid and bent in a zig-zag manner. As a result, it does not look naturally like a rope. Thus, I left out the damping coefficient and retain just the stiffness coefficient to calculate the spring force between two atoms.

 

Ipod showing rigidity of cord when hooke’s spring force is applied

Text Box: Orientation of Ipod
1.	Find the vector between the last two atoms
2.	Cross multiply this vector with the y axis to obtain the axis of rotation
3.	Also, find the angle B between the y axis and this vector
4.	Rotate about the calculated axis of rotation by B amount
 

EXTRA FEATURE : YOU CAN CLICK ON THE IPOD TO PLAY MUSIC! In addition , press 'D' to hold a concert!


Keyboard Controls

Rope coefficients

·       ‘1’ : Increase stickiness coefficient

·       ‘2’ : Decrease stickiness coefficient

·       ‘3’ : Increase spring restlength

·       ‘4’ : Decrease spring restlength

·       ‘5’ : Increase air friction

·       ‘6’ : Decrease air friction

·       ‘7’ : Increase stiffness coefficient

·       ‘8’ : Decrease stiffness coefficient

·       ‘9’ : Increase time step

·       ‘0’ : Decrease time step

·       ‘[‘ : Increase dampness coefficient

·       ‘]’ : Decrease dampness coefficient

 

Rope Controls

·       ‘w’: Move rope in position z-direction

·       ‘s’ : Move rope in negative z-direction

·       ‘a’: Move rope in position x-direction

·       ‘d’ : Move rope in negative x-direction

·       ‘q’: Move rope in position y-direction

·       ‘e’ : Move rope in negative y-direction

·       ‘n’ : Look up

·       ‘m’ : Look down

 

Game Controls

·       ‘D’ : See Michael Jackson dance!

·       Up : Move forward

·       Down : Move backward

·       Left : Rotate Left

·       Right : Rotate Right

·       ‘p’ : Pause


Mouse Control

You can click to select any of the coefficient on the top right hand corner. Move left to decrease value while move right to increase.

References:

1.      Nehe Productions Lesson 40 , http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=40

2.      Game Developing Community Network,  http://www.allegro.cc/forums/thread/588302/624300

3.      Wikipedia – Quaternions, http://en.wikipedia.org/wiki/Quaternion

Source

Final Project Source File

Video of the ipod and the dancing men