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.
Page Index Toggle Pages: 1
PeasyCam on/off (Read 1805 times)
PeasyCam on/off
Jan 8th, 2010, 2:26pm
 
Hello,

I use PeasyCam all the time.

Now I have a question...

1.
How can I freeze it?
How can I disable all the handlers (left,right,middle-click etc.) at once?
How can I later set all the handlers back to normal?

2.
How can I place a rect with beginHUB in front of all other items ion the screen?

Thanks!!!!

Greetings,

Chrisir



Re: PeasyCam on/off
Reply #1 - Jan 8th, 2010, 8:58pm
 
1. This will turn the PeasyCam off/on.  In doing so, it disables all the handlers.
Code:
camera.setMouseControlled(false);  //PeasyCam off
camera.setMouseControlled(true);  //PeasyCam on


If you truly want to remove the 3d centered focus (reset), you can do this.
Code:
camera(); 



2. Draw the rect as the last thing in the sketch.  Might need to add this:
Code:
hint(DISABLE_DEPTH_TEST); 

Re: PeasyCam on/off
Reply #2 - Jan 9th, 2010, 6:15am
 


Thank you!!!

Re: PeasyCam on/off
Reply #3 - Jan 9th, 2010, 2:46pm
 


Next Question:

MrFeinberg, can you please :
make
camera.rotateX(double angle);  // rotate around the x-axis passing through the subject
camera.rotateY(double angle);  // rotate around the y-axis passing through the subject
camera.rotateZ(double angle);  // rotate around the z-axis passing through the subject

with an entry
, long animationTimeInMillis);

That'd be pretty cool!

Greetings, Chrisir


Re: PeasyCam on/off
Reply #4 - Jan 9th, 2010, 2:57pm
 
oh, yes, this would be cool.  was in the need of something like that just some days ago
Re: PeasyCam on/off
Reply #5 - Jan 10th, 2010, 6:36pm
 
I actually can't do what you folks are asking for. It's hard to explain the reason, but it has to do with the difference between the other setFoo methods (which all set some property to specific value) and the rotateFoo methods (which *change* the current value by the given amount). There's no good semantics for what to do if some rotateX is running and then you call rotateY. Do I set the target rotation to whatever it happens to be at this moment, plus the new Y rotation? Do I add the Y rotation to the current target rotation? If so, how do I separate the two different animation speeds?

The PeasyCam rotation is not stored as 3 separate angles; it's stored as a single quaternion. The only way I could give you an animatable rotation would be to expose the underlying commons.math.Rotation object, which is something I really don't want to do (because it would suddenly make the PeasyCam interface much more complicated, and expose an internal implementation detail that's best left abstracted, I think).
Re: PeasyCam on/off
Reply #6 - Jan 10th, 2010, 11:34pm
 
so what would be your way to make the camera rotate about an object ?
use camera.rotateX( a);  in draw and countup a ?
Re: PeasyCam on/off
Reply #7 - Jan 11th, 2010, 7:01am
 
rotateX() changes the current rotation of the camera around the X axis by the given amount. You could rotateX(someSmallNumber) once per frame, for a while. But you wouldn't want to "countup a", because that would accelerate the rotation.
Re: PeasyCam on/off
Reply #8 - Jan 11th, 2010, 7:48am
 
k, makes sense
Page Index Toggle Pages: 1