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 breaking change coming
Page Index Toggle Pages: 1
Peasycam breaking change coming (Read 1817 times)
Peasycam breaking change coming
Apr 22nd, 2010, 3:59pm
 
I've decided to strike the getRotations/setRotations methods. The rationale for getRotations() was to make a heads-up display possible, but Peasycam now supports HUDs directly. The next version of Peasycam will not have getRotations()/setRotations().
Re: Peasycam breaking change coming
Reply #1 - Apr 22nd, 2010, 7:21pm
 
I still use that function for billboarding text in the 3d environment.  It won't work as a HUD function as far as I know. Does the new getState() function replace this feature? I can't get it to work as I did with rotations.
Re: Peasycam breaking change coming
Reply #2 - Apr 23rd, 2010, 6:09am
 
The thing you want is

Code:
void draw() {
   // draw your 3D universe
   cam.beginHUD();
   // draw your text and controls
   cam.endHUD();
}
Re: Peasycam breaking change coming
Reply #3 - Apr 23rd, 2010, 6:59am
 
That doesn't work for what I'm describing.
Here is a piece of sample code...  The text has to stay in the 3d camera environment, just rotate.
Code:
import peasy.*;

PeasyCam cam;
float[] rotations = new float[3];

void setup() {
 size(300,300,P3D);
 cam = new PeasyCam(this, 100);
 cam.setMinimumDistance(50);
 cam.setMaximumDistance(500);
}
void draw() {

 background(0);
 rotations = cam.getRotations();
 
 fill(255,255,255);
 box(2);  //center
 
 pushMatrix();
 translate(0,30,0);
 fill(255,0,0);
 box(10);
 popMatrix();
 
 pushMatrix();
 translate(0,-30,0);
 fill(0,255,0);
 box(10);
 popMatrix();

 
 pushMatrix();
 translate(0,30,0);
 rotateX(rotations[0]);
 rotateY(rotations[1]);
 rotateZ(rotations[2]);
 fill(255,255,255);
 textAlign(CENTER);
 text("My Red Box",0,20,0);
 popMatrix();
 
 pushMatrix();
 translate(0,-30,0);
 rotateX(rotations[0]);
 rotateY(rotations[1]);
 rotateZ(rotations[2]);
 fill(255,255,255);
 textAlign(CENTER);
 text("My Green Box",0,20,0);
 popMatrix();
}
Re: Peasycam breaking change coming
Reply #4 - Apr 23rd, 2010, 7:21am
 
Ah! Right. Fair enough; I'll keep it in. Thanks for explaining.
Page Index Toggle Pages: 1