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 › Announce: PeasyCam 0.6.0
Pages: 1 2 
Announce: PeasyCam 0.6.0 (Read 5892 times)
Announce: PeasyCam 0.6.0
Aug 26th, 2009, 8:25am
 
I'm happy to announce the availability of version 0.6.0 of my camera-control library for 3D sketches, PeasyCam ("P" for Processing, "Peasy" for easy-peasy).

 http://mrfeinberg.com/peasycam/

This version introduces a brace of methods, courtesy of A.W. Martin, which make it easy-peasy to maintain a heads-up display, or HUD. In your draw() method, simply call cam.beginHUD() and cam.endHUD() around anything you'd like draw relative to the camera's position and orientation.

Development is hosted at GitHub:

 http://github.com/jdf/peasycam/

Code:
PeasyCam camera;

void setup() {
   camera = new PeasyCam(this, 0, 0, 0, 50);
}

That's it. Now a mouse left-drag will rotate the camera around the subject, a right drag will zoom in and out, and a middle-drag (command-left-drag on mac) will pan. A double-click restores the camera to its original position.

It is free for all uses, per the Apache 2.0 license. Please try it out, and let me know how it goes for you.
Re: Announce: PeasyCam 0.6.0
Reply #1 - Sep 1st, 2009, 11:09am
 
Hi,
thanks for your work with the library.
I've done a quick test about the HUD feature; maybe i get it wrong, but it's not working for me.

Code:
import processing.opengl.*;
import peasy.*;

PeasyCam cam;

void setup() {
 size(600, 600, OPENGL);
 cam = new PeasyCam(this, 300);
 smooth();
}

void draw() {
 background(255);
 fill(230);
 box(100);
 pushMatrix();
 translate(0,0,70);
 box(50);
 popMatrix();
 
 cam.beginHUD();
   fill(255,100,0);
   rect(0,0,width,100);
 cam.endHUD();
}
Re: Announce: PeasyCam 0.6.0
Reply #2 - Sep 16th, 2009, 8:02am
 
This came in at just the right time for me.

Thanks Jonathan and congrats for the awesome library.

Gian Chatz

--oh, and a tiny suggestion: maybe you could incorporate this function in the example app on your webpage.

Re: Announce: PeasyCam 0.6.0
Reply #3 - Sep 16th, 2009, 10:53am
 
After fiddling with the library a little more, I came to the following findings:

1. While orientation works perfectly, the size of the "HUD" elements in the viewport does not seem to be correct. In particular, I had to do a translate in the z axis by an arbitrary value in order to scale it correctly and fit the viewport. It seems that this depends on the dimensions of the viewport. Any clues?

2. Somehow irrelevant to HUD, but still: I found no way of determining whether mouseControlled property is true or false. Is there any way to do it? Maybe implement it?

Otherwise, I think that it is a great addition to an already great library!

Gian Chatz
Re: Announce: PeasyCam 0.6.0
Reply #4 - Sep 18th, 2009, 9:14am
 
If you find out the details, please keep us posted.  You may want to e-mail or PM Jon.  At the moment, I'm using a different method for a HUD with PeasyCam so I haven't had a need to test this new feature out, but I love the simplicity of it and would consider using it in the future.

Here is what I'm currently doing:
Code:

import peasy.*;

PeasyCam cam;
PMatrix3D currCameraMatrix;
PGraphics3D g3;

void setup() {
 size(200,200,P3D);
 cam = new PeasyCam(this, 100);
 cam.setMinimumDistance(50);
 cam.setMaximumDistance(500);
 g3 = (PGraphics3D)g;
 hint(DISABLE_DEPTH_TEST);
}

void draw(){

 rotateX(-.5);
 rotateY(-.5);
 background(0);
 fill(255,0,0);
 box(30);
 pushMatrix();
 translate(0,0,20);
 fill(0,0,255);
 box(5);
 popMatrix();

 currCameraMatrix = new PMatrix3D(g3.camera);
 camera();
 //  Start HUD
 fill(255);
 rect(10,10,80,30);
 //  End HUD
 g3.camera = currCameraMatrix;
}
Re: Announce: PeasyCam 0.6.0
Reply #5 - Sep 26th, 2009, 6:45pm
 
Jeff, I considered using your method I was just wondering: It is not affected by the default transition time of the camera( like the time it takes for the camera to e.g. go to default after a double click)?

As for the HUD function, I didn't have time to test it anymore further, as soon as I do I will let you and Jonathan know.

Gian Chatz
http://prototy.blogspot.com
Re: Announce: PeasyCam 0.6.0
Reply #6 - Sep 27th, 2009, 5:51am
 
I'm sorry, I don't understand your question.  The hud stays in place during any 3d camera movement going on in the background.  I haven't had any issues and I use it quite a bit.  My main thought on using the built in method was for coding simplicity, and perhaps a slight performance improvement (not sure if the built in method does it more efficiently).
Re: Announce: PeasyCam 0.6.0
Reply #7 - Oct 3rd, 2009, 1:07pm
 
I'm having an installation issue?

That's what I'm getting when I try to run HelloPeasy:
Quote:
Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

I have it in place, I can even load the example of the PeasyCam, and have other libraries working fine. Any idea what might be wrong?
Re: Announce: PeasyCam 0.6.0
Reply #8 - Oct 4th, 2009, 8:13am
 
MeLight wrote on Oct 3rd, 2009, 1:07pm:
I'm having an installation issue

That's what I'm getting when I try to run HelloPeasy:
Quote:
Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

I have it in place, I can even load the example of the PeasyCam, and have other libraries working fine. Any idea what might be wrong


This is probably due to faulty naming. Names are case-sensitive, make sure the library folder has the same name as the .jar file.
Re: Announce: PeasyCam 0.6.0
Reply #9 - Nov 24th, 2009, 5:48am
 
Jonathan posted 0.61 which fixes the HUD scaling problem. Check his website.
Re: Announce: PeasyCam 0.6.0
Reply #10 - Nov 28th, 2009, 11:54am
 
hi there,

gratulations for this awesome library.

I was wondering if there is a way to change from mouse controlling to keyboard controlling?
Re: Announce: PeasyCam 0.6.0
Reply #11 - Nov 28th, 2009, 11:54am
 
hi there,

gratulations for this awesome library.

I was wondering if there is a way to change from mouse controlling to keyboard controlling?
Re: Announce: PeasyCam 0.6.0
Reply #12 - Mar 22nd, 2010, 8:16am
 
Hi all,

i am using pEasyCam, but i somehow cannot get to display simple shapes to the screen whithout them being affected by the camera. I would like to have a rectangle containing a set of buttons alwas on top of the actual objects of the scene, for the user to select stuff, but i cannot get it to work...

any suggestions?

thanks in advance, and thanks for the libraries, they make life soo easier!

adolfo
Re: Announce: PeasyCam 0.6.0
Reply #13 - Mar 22nd, 2010, 4:03pm
 
use the HUD option

cam.beginHUD();
//draw your buttons and stuff
cam.endHUD();
Re: Announce: PeasyCam 0.6.0
Reply #14 - Mar 26th, 2010, 1:23pm
 
I've been experimenting with using the library along with the org.apache.math.commons.geometry stuff that its based on. I can use the Vector3D and Rotation stuff from the Math library (without any extra imports), but there is a new version of Math with new functions that can't be used because Peasy is using an older version. Is it just because Math was updated more recently that the newest version isn't included or is there some other reason? Do you plan to use the newer version for future releases?
Pages: 1 2