We are about to switch to a new forum software. Until then we have removed the registration on this forum.
greeting, have you any idea about how can i change the models texture in this programme
import saito.objloader.*;
import codeanticode.gsvideo.*;
import controlP5.*;
ControlP5 controlP5;
OBJModel model;
GSCapture cam;
float thetaX = 0.0;
float thetaY = 0.0;
void setup(){
size(640, 480, P3D);
model = new OBJModel(this,"");
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 keyPressed() {
if (keyPressed) {
if (key == 'w' ) {
model = new OBJModel(this,"fauteuilblend.obj");
model.scale(65);
model.translateToCenter();
noStroke();
}
if (key == 'd' ) {
model = new OBJModel(this,"saloncomplet2.obj");
model.scale(40);
model.translateToCenter();
noStroke();
}
if (key == 'a' ) {
model = new OBJModel(this,"saloncomplet.obj");
model.scale(50);
model.translateToCenter();
noStroke();
}
if (key == 'q' ) {
model = new OBJModel(this,"chair.obj");
model.scale(50);
model.translateToCenter();
noStroke();
}
}
}
void draw(){
if (cam.available()) {
cam.read(); // read the cam image
lights();
background(cam);
translate( width/2, height/2);
fill(180, 0, 0, 127);
if (mousePressed) {
thetaY -= radians(pmouseX-mouseX);
thetaX += radians(pmouseY-mouseY);
}
rotateX(thetaX);
rotateY(thetaY);
directionalLight(51, 102, 126, 0, -1, 0);
ambientLight(102, 102, 102);
model.draw();
}}