This page was last updated: February 4, 2018
The goal of this project is to create an animation by using the Processing transformation calls rotate( ), scale( ), and translate( ). The choice of what the animation does is up to you, but it must use all of those 3 functions. It can use any other functions you want. It can use any keyboard keys to do anything you want.
int Frame = 0;
Frame = Frame + 1; if( Frame > some number you pick ) Frame = 0;
Use the Teach system to turn in your:
int Frame = 0; // current frame number
int MaxFrame = 100; // maximum frame number
void
setup( )
{
size( 800, 800 );
background( 200, 200, 255 );
fill( 255, 0, 0 );
stroke( 0, 0, 0 );
}
void
draw( )
{
background( 200, 200, 255 );
int red = int( map( Frame, 0, MaxFrame, 255, 0 ) );
fill( red, 100, 100 );
pushMatrix( );
translate( 300, 300 );
float deg = map( Frame, 0, MaxFrame, 0, 360 );
rotate( radians(deg) );
rect( 0, -25, 200, 50 );
popMatrix( );
Frame = Frame + 1;
if( Frame > MaxFrame )
Frame = 0;
}
| Item | Points |
| Animates using rotate, scale, translate | 80 |
| Correctly starts over after some number of Frames | 20 |
| Potential Total | 100 |