I’m getting a strange effect when trying to render stroke & fill on an imported obj, the stroke appears to only be rendered once at first frame , almost as an orthographic projection, this stroke rotates with the box as expected but is flat.
As a simple example, take the G4P_ViewListeners example file, import a simple .obj and set up some shading:
PShape box;
void settings() {
size(600, 380, P2D);
}
void setup() {
box = loadShape("data/"+"box.obj");
box.setStroke(true);
box.setStroke(color(42, 100, 138));
box.setStrokeWeight(2.0f);
box.setFill(color(50, 50, 50));
and replace the box(80) in the “ShowBox” tab with the pshape:
v.beginDraw();
//v.ambientLight(100, 100, 10);
//v.directionalLight(255, 255, 0, 0.5f, 1, -2f);
v.background(0);
v.translate(v.width/2, v.height/2);
v.rotateX(0.19f * a);
v.rotateY(1.101f * a);
v.rotateZ(1.357f * a);
//v.fill(255, 200, 128);
//v.stroke(255, 0, 0);
//v.strokeWeight(4);
v.shape(box);
//v.box(80);
a += delta;
v.endDraw();
Could be this is not a problem with G4P as such but inherited from PGraphics… though I’ve been able to render stroke and fill on an imported obj when not using G4P.
Has anyone any ideas?