In my sketch, I have put my 3d rendering into a PGraphics object. But now, I have no way, whatsoever of drawing textures on PShape objects. The result is an invisible shape. Does anyone know what to do or has had this issue before?
I tried…
model.setTexture(PImage);
PShape face = new PShape();
face = createShape();
face.beginShape();
face.textureMode(NORMAL);
face.noStroke();
face.texture(PImage); //<--------------------
for (int v = 0; v < verts.length; v++) { //iterate through each vert
String coords[] = split(verts[v], ",");
String UVcoords[] = split(UVverts[v], ",");
face.vertex(parseFloat(coords[0]), parseFloat(coords[1]), parseFloat(coords[2]), parseFloat(UVcoords[0]), 0-parseFloat(UVcoords[1]));
}
face.endShape(CLOSE);
model.addChild(face);
PShape face = new PShape();
face = createShape();
face.beginShape();
face.textureMode(NORMAL);
face.noStroke();
PGraphicsObject.texture(PImage); //<--------------------
for (int v = 0; v < verts.length; v++) { //iterate through each vert
String coords[] = split(verts[v], ",");
String UVcoords[] = split(UVverts[v], ",");
face.vertex(parseFloat(coords[0]), parseFloat(coords[1]), parseFloat(coords[2]), parseFloat(UVcoords[0]), 0-parseFloat(UVcoords[1]));
}
face.endShape(CLOSE);
model.addChild(face);
Nothing has worked.