|
Author |
Topic: newbe question (Read 257 times) |
|
kuulio
|
newbe question
« on: Feb 6th, 2004, 10:15am » |
|
I want to rotate an bitmap image that I have loaded. How can I do it easily? thanks kuulio
|
|
|
|
kevinP
|
Re: newbie question
« Reply #1 on: Feb 6th, 2004, 12:09pm » |
|
Hi, Check out the rotate() command. You'll see in the example in the Reference section that you'll first want to use translate(). This moves your coordinate starting point (0, 0) to your intended centerpoint of rotation. (rotate uses 0,0). rotate() also expects to see radians not degrees (TWO_PI is 360 deg., PI is 180, etc.).
|
Kevin Pfeiffer
|
|
|
ramastar Guest
|
Re: newbe question
« Reply #2 on: Feb 8th, 2004, 7:34pm » |
|
What's wrong with this script? It doesn't rotate the image, but draws a new image on top of the previous and builds the rotation like this in frames... I just want to rotate the loaded image. BImage img; float angle; void setup(){ size(200,200); background(200); smooth(); img = loadImage("test.jpg"); imageMode(CENTER_DIAMETER); } void loop(){ angle += 0.08; translate(width/2,height/2); rotateZ(angle); image(img, 0, 0); }
|
|
|
|
arielm
|
Re: newbe question
« Reply #3 on: Feb 8th, 2004, 8:43pm » |
|
try to move "background(200)" which is currently inside "setup()" to the beginning of "loop()" (the syntax you used was working once, but it was around version 059...)
|
Ariel Malka | www.chronotext.org
|
|
|
|