I’m having trouble figuring out why some models appear with 3D shading, as expected, and some are flat with no depth. Here’s a minimal example with two models that don’t/do work:
PShape bunny;
PShape ladybug;
void setup() {
size(800, 800, P3D);
bunny = loadShape("bunny.obj");
ladybug = loadShape("ladybug.obj");
}
void draw() {
background(#FFFFFF);
lights();
shape(bunny, width/2, height/2, 200, 200); // bad, flat
//shape(ladyBug, width/2, height/2, 200, 200); // good, 3D
}
Here’s the ladybug obj, which renders ok: http://www.cadnav.com/plus/download.php?open=2&id=48686&uhash=575855a99c364c1025fac85f
And here’s the bunny, which is flat: https://graphics.stanford.edu/~mdfisher/Data/Meshes/bunny.obj
I’m not worried about texture or materials, which I know the bunny doesn’t have here. The same thing happens if I add a material in the .obj file. I’m only worried about the 3D shading. I have a number of other objects that have the same problem, some of which have both vertex normals (vn) and texture vertices (vt), which don’t seem to make any difference.
What am I missing?
Here’s the flat bunny result: