Hi, I noticed that the current implementation of the Cylinder primitive doesn't create the caps correctly.
One side has the triangles wound in the wrong direction:
if ( closed && axisCount == 0 ) {
tb.getIndexBuffer().put( i0++ );
tb.getIndexBuffer().put( i1++ );
tb.getIndexBuffer().put( tb.getVertexCount() - 2 );
}
else if ( closed && axisCount == axisSamples - 2 ) {
tb.getIndexBuffer().put( i2++ );
tb.getIndexBuffer().put( i3++ );
tb.getIndexBuffer().put( tb.getVertexCount() - 1 );
This should be:
if ( closed && axisCount == 0 ) {
tb.getIndexBuffer().put( i0++ );
tb.getIndexBuffer().put( tb.getVertexCount() - 2 );
tb.getIndexBuffer().put( i1++ );
}
else if ( closed && axisCount == axisSamples - 2 ) {
tb.getIndexBuffer().put( i2++ );
tb.getIndexBuffer().put( i3++ );
tb.getIndexBuffer().put( tb.getVertexCount() - 1 );
The normals are also screwy, but I think the only way to get correct normals is to use a non-capped Cylinder plus 2 separate Disk primitives.
Anyway, just wanted to let you know.