Skip to content

Instantly share code, notes, and snippets.

@jbum
Created August 11, 2015 05:45
Show Gist options
  • Save jbum/486d4386f48ad08596b2 to your computer and use it in GitHub Desktop.
Save jbum/486d4386f48ad08596b2 to your computer and use it in GitHub Desktop.
PImage myImage;
void setup()
{
size(500,500);
myImage = loadImage("test.png");
}
void draw()
{
background(255);
float speedOfRotation = .01; // higher values go faster, e.g. .02 is double speed
float amtToRotate = millis()*speedOfRotation;
int x = 100, y = 100; // where to place the image
pushMatrix();
translate(x,y);
rotate(amtToRotate);
image(myImage, -myImage.width/2, -myImage.height/2);
popMatrix();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment