Hello, im new in processing and i need your help. I want to manipulate a loaded object in proscene with a GUI. For my design are the g4p controls the best and i love the GUI builder.
But i have at the momet this problem: when i resize the window, the G4P controls loose their positions on the window. and they are then disabeld in the new position!
Could you explain please what am i missing here and how i can fix the controls in their Postions when i resize the window?! this is the code i have till now:
import g4p_controls.*;
import remixlab.proscene.*;
GButton btn1,btn2;
Scene scene;
PMatrix3D currCameraMatrix;
PGraphics3D g3;
void setup() {
size(1200,800,P3D);
//G4P Control
btn1 = new GButton(this,25,60,70,25); // loose Position when i resize the window...
btn1.setText("G4P_btn1");
btn2 = new GButton(this,25,120,70,25); // loose Position when i resize the window...
btn2.setText("G4P_btn2");
scene = new Scene(this);
g3 = (PGraphics3D)g;
}
void draw() {
background(0);
fill(255,0,0);
noStroke();
box(30);
gui();
}
void gui() {
hint(DISABLE_DEPTH_TEST);
currCameraMatrix = new PMatrix3D(g3.modelview);
float cameraZ = ((height/2.0) / tan(PI*60.0/360.0));
perspective(PI/3.0, scene.camera().aspectRatio(), cameraZ/10.0, cameraZ*10.0);
camera();
strokeWeight(3);
stroke(200);
noFill();
rect(25, 35, 70, 110);
g3.camera = currCameraMatrix;
hint(ENABLE_DEPTH_TEST);
}
Thank you