We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Re: weird peasycam rotations values
Page Index Toggle Pages: 1
Re: weird peasycam rotations values (Read 1280 times)
Re: weird peasycam rotations values
Apr 21st, 2010, 6:40am
 
i'm guessing it's using atan2

http://en.wikipedia.org/wiki/Atan2

look at the diagram at the very bottom, on the left, and you'll see a jump where one of the values crosses HALF_PI

(1.57 = HALF_PI)
Re: weird peasycam rotations values
Reply #1 - Apr 21st, 2010, 7:29am
 
koogy wrote on Apr 21st, 2010, 6:40am:
i'm guessing it's using atan2...

Thanks koogy. Do you think one can grab these values and pass them to the buffer to rotate an object
Something with map(value, min, max, newmin, newmax)
Re: weird peasycam rotations values
Reply #2 - Apr 22nd, 2010, 7:53am
 
Solved!
With the latest version of PeasyCam, mr Feinberg added a new method for CameraState:
apply(processing.core.PGraphics g)

So to render 'on demand' with the SAME angles you see in the display window, that's all you need to do:

case 's':
noLoop();  
recorder = createGraphics(width, height, "hipstersinc.P5Sunflow");
recorder.beginDraw();
cam.getState().apply(recorder); // apply the latest CameraState
scale(30.0); // a scale factor is needed
draw();
recorder.endDraw();
recorder.save((int) random(10000)+".png");
recorder = null;
loop();
break;

Page Index Toggle Pages: 1