Has anybody encountered this error before:
Code:
java.lang.RuntimeException: nan triangle
at processing.core.PGraphics3D.depth_sort_triangles_compare(PGraphics3D.java:1316)
at processing.core.PGraphics3D.depth_sort_triangles_partition(PGraphics3D.java:1289)
at processing.core.PGraphics3D.depth_sort_triangles_internal(PGraphics3D.java:1279)
at processing.core.PGraphics3D.depth_sort_triangles(PGraphics3D.java:1272)
at processing.core.PGraphics3D.flush(PGraphics3D.java:406)
at processing.core.PGraphics3D.endDraw(PGraphics3D.java:384)
The pertinent part of the draw loop looks like this:
Code:
background(0);
hint(ENABLE_DEPTH_SORT);
//println(obList.size() + " objects to draw.");
for ( int i = 0; i < obList.size(); i++)
{
ImgObject ob = (ImgObject)obList.get(i);
ob.update();
ob.draw();
}
fill(255);
sphere(10);
cam.feed();
And the draw function of ImgObject looks like this (img is a PImage member variable, x, y, and z are float member variables):
Code:
//println("Drawing object with ID " + ID);
fill(255);
noStroke();
pushMatrix();
translate(x, y, z);
beginShape();
texture(img);
vertex(0, 0, 0, 0, 0);
vertex(0, 0, img.height, 0, 1);
vertex(img.width, 0, img.height, 1, 1);
vertex(img.width, 0, 0, 1, 0);
endShape();
popMatrix();
I tried switching to OPENGL and wound up with a similar error, but a trace from the JOGL functions, of course. So I suspect it is not necessarily a bug in Processing, but merely some sort of mistake on my part.