We are about to switch to a new forum software. Until then we have removed the registration on this forum.
greeting, I want to know how to create a button event in code out the one cam is active .. the button is used to change an object displayed in the execution with another object in the database and given thank you :)
**this is my code and it's work, but i missed the button event to chande the objet 3D from the data base **
import saito.objloader.*;
import codeanticode.gsvideo.*;
OBJModel model;
GSCapture cam;
//String camPara = "C:/Users/MSR.info/Documents/Processing/libraries/nyar4psg/data/camera_para.dat";
void setup(){
size(640, 480, P3D);
model = new OBJModel(this,"mankey.obj");
model.scale(90);
model.translateToCenter();
noStroke();
cam = new GSCapture(this, 640, 480); // initialize the webcam capture at a specific resolution (correct and/or possible settings depend on YOUR webcam)
cam.start(); // start capturing
}
void draw(){
if (cam.available()) {
cam.read(); // read the cam image
background(cam); // a background call is needed for correct display of the marker results
//image(cam, 0, 0, width, height); // display the image at the width and height of the sketch window
// create a copy of the cam image at the resolution of the AR detection (otherwise nya.detect will throw an assertion error!)
//translate (width/2, height/2, 0);
fill(180, 0, 0, 127);
translate(mouseX, mouseY);
rotateX(mouseX*0.01);
rotateY(mouseY*0.01);
//box(100);
// scale(40);
lights();
// translate (width/2, height/2, 0);
model.draw();
}}