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 › PeasyCam - Set CamState
Page Index Toggle Pages: 1
PeasyCam - Set CamState (Read 2647 times)
PeasyCam - Set CamState
Dec 30th, 2009, 10:42am
 


Hello,

I love PeasyCam!

But how can I set the CamState in PeasyCam?

 camState = cam.getState ();
 camState.center.X = 300;
 camState.center.Y = 700;
 camState.center.Z = 60;
(how does this work??)

do something.....

I then want to call the state via

   cam.setState( camState, 900 );

But I don't know how to set the coordinates.

Thanks!

Greetings, happy new year!

Chris

Re: PeasyCam - Set CamState
Reply #1 - Dec 30th, 2009, 7:10pm
 
The PeasyCam "state" is meant to be an opaque, meaningless object, only meant for saving the camera's setting at a moment in time, and restoring it later.

All of the PeasyCam methods are documented at the home page, http://mrfeinberg.com/peasycam/. Perhaps you want

Code:
camera.lookAt(double x, double y, double z);
camera.setDistance(double d);


?


Re: PeasyCam - Set CamState
Reply #2 - Jan 2nd, 2010, 1:42am
 

Hello Mr Feinberg,

thank you very much for answering personally.

May goal is to move the camera with an animation,
with a slow sweeep.

In your library this can be done via

         cam.setState( camStateMoving, 900 );

with the code
camera.lookAt(double x, double y, double z);
camera.setDistance(double d);  
I don't have a nice animation of the movement of the camera.

I'd need a function to give me a part of a circle or a 3D-spline on which to move the camera step by step but the math fail me.

Thanks!

Happy new year!

Chris

Re: PeasyCam - Set CamState
Reply #3 - Jan 2nd, 2010, 7:48am
 
Sounds very interesting...

Your problem made me think of the new Tween library.  Maybe you could position the camera movement with that (http://ekeneijeoma.com/processing/tween/).
Re: PeasyCam - Set CamState
Reply #4 - Jan 2nd, 2010, 8:15am
 
as far as i know this is already implemented in peasy cam.
Re: PeasyCam - Set CamState
Reply #5 - Jan 3rd, 2010, 3:31am
 
Hello Cedric,

thanky for your reply!

I am not sure what you are referring to...

CamState there is of course in PeasyCam.

But I can't figure out how to define a new remote
camera-state and send the camera slowly there.

Maybe you can give me a hint.

Thanky also for the other reply which looks promising!

Happy new year!

Chris

Re: PeasyCam - Set CamState
Reply #6 - Jan 3rd, 2010, 10:07am
 
you are right, i had in mind that it could be animated. but its only the lookat and state that could be animated. not the rotation. i am wondering why. would be nice to be added.
Re: PeasyCam - Set CamState
Reply #7 - Jan 4th, 2010, 2:49pm
 
Thanks for your reply!

Chrisir

Re: PeasyCam - Set CamState
Reply #8 - Jan 7th, 2010, 10:58am
 
I'm sorry I haven't been replying. I thought I had this forum set to send me mail on new posts, but I've received nothing.

PeasyCam doesn't know where the camera is, so to speak. It knows how far it is from its look-at point, and it knows how to orbit itself around its look-at point in terms of a quaternion representation of a rotation. So there *is* no way to directly position the camera.

I don't do interpolations on rotateX/Y/Z because those methods apply changes to the current rotation; they don't set an absolute rotation. The methods that do animations are all aiming towards fixed values.
Re: PeasyCam - Set CamState
Reply #9 - Jan 7th, 2010, 2:43pm
 

Hello!

Thanks for your reply!

Greetings!

Chris

Page Index Toggle Pages: 1