Posted By

studioevoque on 05/24/11


Tagged

java Processing


Versions (?)

Rotating an Image around it's center


 / Published in: Processing
 

URL: http://processing.org/discourse/yabb2/YaBB.pl?num=1251909297

  1. float counter;
  2. PImage img;
  3.  
  4. void setup()
  5. {
  6. counter=0.0;
  7. size(300,300);
  8. img=loadImage("brownplane.png");
  9. }
  10.  
  11. void draw()
  12. {
  13. background(0);
  14. counter++;
  15. translate(width/2-img.width/2, height/2-img.height/2);
  16. rotate(counter*TWO_PI/360);
  17. translate(-img.width/2, -img.height/2);
  18. image(img,0,0);
  19. }

Report this snippet  

You need to login to post a comment.