nb.put(0).put(insideView ? 1 : -1).put(0);
tb.put(0.5f).put(1.0f);
// allocate connectivity
int triCount = (planes - 2) * radialSamples * 2 + radialSamples;
ShortBuffer ib = BufferUtils.createShortBuffer(3 * triCount);
setBuffer(Type.Index, 3, ib);
// generate connectivity
int index = 0;
// Generate only for middle planes
for (int plane = 1; plane < (planes - 1); plane++) {
int bottomPlaneStart = ((plane - 1) * (radialSamples + 1));
int topPlaneStart = (plane * (radialSamples + 1));
for (int sample = 0; sample < radialSamples; sample++, index += 6) {
if (insideView){
ib.put((short) (bottomPlaneStart + sample));
ib.put((short) (bottomPlaneStart + sample + 1));
ib.put((short) (topPlaneStart + sample));
ib.put((short) (bottomPlaneStart + sample + 1));
ib.put((short) (topPlaneStart + sample + 1));
ib.put((short) (topPlaneStart + sample));
}else{
ib.put((short) (bottomPlaneStart + sample));
ib.put((short) (topPlaneStart + sample));
ib.put((short) (bottomPlaneStart + sample + 1));
ib.put((short) (bottomPlaneStart + sample + 1));
ib.put((short) (topPlaneStart + sample));
ib.put((short) (topPlaneStart + sample + 1));
}
}
}
// pole triangles
int bottomPlaneStart = (planes - 2) * (radialSamples + 1);
for (int samples = 0; samples < radialSamples; samples++, index += 3) {
if (insideView){
ib.put((short) (bottomPlaneStart + samples));
ib.put((short) (bottomPlaneStart + samples + 1));
ib.put((short) (vertCount - 1));
}else{
ib.put((short) (bottomPlaneStart + samples));
ib.put((short) (vertCount - 1));
ib.put((short) (bottomPlaneStart + samples + 1));
}
}
updateBound();
}