afSin[_radialSamples] = afSin[0];
afCos[_radialSamples] = afCos[0];
// generate the sphere itself
int i = 0;
final Vector3 tempVa = Vector3.fetchTempInstance();
final Vector3 tempVb = Vector3.fetchTempInstance();
final Vector3 tempVc = Vector3.fetchTempInstance();
for (int iZ = 1; iZ < (_zSamples - 1); iZ++) {
final double fAFraction = MathUtils.HALF_PI * (-1.0f + fZFactor * iZ); // in (-pi/2, pi/2)
final double fZFraction = MathUtils.sin(fAFraction); // in (-1,1)
final double fZ = _radius * fZFraction;
// compute center of slice
final Vector3 kSliceCenter = tempVb.set(_center);
kSliceCenter.setZ(kSliceCenter.getZ() + fZ);
// compute radius of slice
final double fSliceRadius = Math.sqrt(Math.abs(_radius * _radius - fZ * fZ));
// compute slice vertices with duplication at end point
Vector3 kNormal;
final int iSave = i;
for (int iR = 0; iR < _radialSamples; iR++) {
final double fRadialFraction = iR * fInvRS; // in [0,1)
final Vector3 kRadial = tempVc.set(afCos[iR], afSin[iR], 0);
kRadial.multiply(fSliceRadius, tempVa);
_meshData.getVertexBuffer().put((float) (kSliceCenter.getX() + tempVa.getX()))
.put((float) (kSliceCenter.getY() + tempVa.getY()))
.put((float) (kSliceCenter.getZ() + tempVa.getZ()));
BufferUtils.populateFromBuffer(tempVa, _meshData.getVertexBuffer(), i);