public void updateGeometry(Vector3f center, int planes,
            int radialSamples, float radius, boolean insideView) {
        this.insideView = insideView;
        this.center = center != null ? center : new Vector3f(0, 0, 0);
        this.planes = planes;
        this.radialSamples = radialSamples;
        this.radius = radius;

        int vertCount = ((planes - 1) * (radialSamples + 1)) + 1;

        // Allocate vertices, allocating one extra in each radial to get the
        // correct texture coordinates
//        setVertexCount();
//        setVertexBuffer(createVector3Buffer(getVertexCount()));

        // allocate normals
//        setNormalBuffer(createVector3Buffer(getVertexCount()));

        // allocate texture coordinates
//        getTextureCoords().set(0, new TexCoords(createVector2Buffer(getVertexCount())));

        FloatBuffer vb = BufferUtils.createVector3Buffer(vertCount);
        FloatBuffer nb = BufferUtils.createVector3Buffer(vertCount);
        FloatBuffer tb = BufferUtils.createVector2Buffer(vertCount);
        setBuffer(Type.Position, 3, vb);
        setBuffer(Type.Normal, 3, nb);
        setBuffer(Type.TexCoord, 2, tb);

        // generate geometry
        float fInvRS = 1.0f / radialSamples;
        float fYFactor = 1.0f / (planes - 1);

        // Generate points on the unit circle to be used in computing the mesh
        // points on a dome slice.
        float[] afSin = new float[(radialSamples)];
        float[] afCos = new float[(radialSamples)];
        for (int iR = 0; iR < radialSamples; iR++) {
            float fAngle = FastMath.TWO_PI * fInvRS * iR;
            afCos[iR] = FastMath.cos(fAngle);
            afSin[iR] = FastMath.sin(fAngle);
        }

        TempVars vars = TempVars.get();
        Vector3f tempVc = vars.vect3;
        Vector3f tempVb = vars.vect2;
        Vector3f tempVa = vars.vect1;

        // generate the dome itself
        int i = 0;
        for (int iY = 0; iY < (planes - 1); iY++, i++) {
            float fYFraction = fYFactor * iY; // in (0,1)
            float fY = radius * fYFraction;
            // compute center of slice
            Vector3f kSliceCenter = tempVb.set(center);
            kSliceCenter.y += fY;

            // compute radius of slice
            float fSliceRadius = FastMath.sqrt(FastMath.abs(radius * radius - fY * fY));

            // compute slice vertices
            Vector3f kNormal;
            int iSave = i;
            for (int iR = 0; iR < radialSamples; iR++, i++) {
                float fRadialFraction = iR * fInvRS; // in [0,1)
                Vector3f kRadial = tempVc.set(afCos[iR], 0, afSin[iR]);
                kRadial.mult(fSliceRadius, tempVa);
                vb.put(kSliceCenter.x + tempVa.x).put(
                        kSliceCenter.y + tempVa.y).put(
                        kSliceCenter.z + tempVa.z);

                BufferUtils.populateFromBuffer(tempVa, vb, i);
                kNormal = tempVa.subtractLocal(center);
                kNormal.normalizeLocal();
                if (!insideView) {
                    nb.put(kNormal.x).put(kNormal.y).put(kNormal.z);
                } else {
                    nb.put(-kNormal.x).put(-kNormal.y).put(-kNormal.z);
                }

                tb.put(fRadialFraction).put(fYFraction);
            }
            BufferUtils.copyInternalVector3(vb, iSave, i);
            BufferUtils.copyInternalVector3(nb, iSave, i);
            tb.put(1.0f).put(fYFraction);
        }

        vars.release();

        // pole
        vb.put(this.center.x).put(this.center.y + radius).put(this.center.z);
        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();
    }
Rebuilds the dome with a new set of parameters.

@param center the new center of the dome.
@param planes the number of planes along the Z-axis.
@param radialSamples the new number of radial samples of the dome.
@param radius the new radius of the dome.
@param insideView should the dome be set up to be viewed from the inside looking out.
jme3-core/src/main/java/com/jme3/scene/shape/Dome.java