Related to processing/processing#2873, we need to clean up the documentation related to iterating over the vertices of a PShape. When loading an obj, getVertexCount() will typically return 0 since all the vertices are in the child shapes. Two ways of iterating over all the vertices are:
PShape obj = loadShape("test.obj");
int children = obj.getChildCount();
for (int i = 0; i < children; i++) {
PShape child = obj.getChild(i);
int total = child.getVertexCount();
for (int j = 0; j < total; j++) {
PVector v = child.getVertex(j);
point(v.x, v.y, v.z);
}
}
and
PShape tes = obj.getTessellation();
int total = tes.getVertexCount();
for (int j = 0; j < total; j++) {
PVector v = tes.getVertex(j);
point(v.x, v.y, v.z);
}
Where should this go? loadShape()? getVertexCount()? getVertex()?
@codeanticode
Related to processing/processing#2873, we need to clean up the documentation related to iterating over the vertices of a PShape. When loading an obj,
getVertexCount()will typically return 0 since all the vertices are in the child shapes. Two ways of iterating over all the vertices are:and
Where should this go?
loadShape()?getVertexCount()?getVertex()?@codeanticode