FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   changing rotation
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: changing rotation  (Read 328 times)
wilson


changing rotation
« on: Apr 20th, 2004, 5:18pm »

Hi, any help on the below problem would be much appreciated:
 
Is there any way to essentialy say:
 
BImage map;
map = loadImage("someimage.jpg");
 
//then
 
imageMode(X, Y) // imaginary syntax
 
translate(by something);
rotate(by something);
 
image(map, 0, 0);  
 
Ok, psedocode aside, I know you can't do that imageMode thing above, but I'm trying to rotate an image of a map around a fluxuating origin -- the problem is there is an onscreen representation of a user, and when that user rotates I want the map to rotate around that user's position.
 
The issue I'm having is when I rotate the map, since it's being drawn from either imageMode(CORNER) or imageMode(CENTER_RADIUS) it always uses those origins to rotate around.
 
Any feedback / suggestions?
 
Thanks guys.
 
_will
 
v3ga

WWW Email
Re: changing rotation
« Reply #1 on: Apr 20th, 2004, 8:35pm »

Hello,
 
what you could do is to draw a textured quad in (XY) plane. Thus, you could set the positions of the quad's corners as desired (in their local coordinates), and then rotate around the z-axis to tranform the quad (thus the image).
 
Hope it helps !
 

http://v3ga.net
narain


Re: changing rotation
« Reply #2 on: Apr 22nd, 2004, 5:49pm »

Or...
(and I've only tried this on a piece of paper)
 
I think you can emulate
"rotate(by something, around (x,y));"
by this:
translate(x,y);
rotate(by something);
translate(-x,-y);
 
Either this, or with the two translates switched (i.e. sign reversed).
 
wilson


Re: changing rotation
« Reply #3 on: Apr 23rd, 2004, 6:06pm »

thanks all for the help!
 
Pages: 1 

« Previous topic | Next topic »