kNormal.normalize(); if (true)
kNormal.normalizeLocal(); if (true)
    private void setGeometryData() {        // allocate vertices        int numVerts = (zSamples - 2) * (radialSamples + 1) + 2;        vertex = new Vector3f[numVerts];        // allocate normals if requested        normal = new Vector3f[numVerts];        // allocate texture coordinates        texture[0] = new Vector2f[numVerts];        // generate geometry        float fInvRS = 1.0f / (float) radialSamples;        float fZFactor = 2.0f / (float) (zSamples - 1);        // Generate points on the unit circle to be used in computing the mesh        // points on a cylinder slice.        float[] afSin = new float[(radialSamples + 1)];        float[] afCos = new float[(radialSamples + 1)];        for (int iR = 0; iR < radialSamples; iR++) {            float fAngle = FastMath.TWO_PI * fInvRS * iR;            afCos[iR] = FastMath.cos(fAngle);            afSin[iR] = FastMath.sin(fAngle);        }        afSin[radialSamples] = afSin[0];        afCos[radialSamples] = afCos[0];        // generate the cylinder itself        int i = 0;        for (int iZ = 1; iZ < (zSamples - 1); iZ++) {            float fZFraction = -1.0f + fZFactor * iZ; // in (-1,1)            float fZ = radius * fZFraction;            // compute center of slice            Vector3f kSliceCenter = (Vector3f)center.clone();            kSliceCenter.z+=fZ;            // compute radius of slice            float fSliceRadius =                FastMath.sqrt(FastMath.abs(radius * radius - fZ * fZ));            // compute slice vertices with duplication at end point            Vector3f kNormal;            int iSave = i;            for (int iR = 0; iR < radialSamples; iR++) {                float fRadialFraction = iR * fInvRS; // in [0,1)                Vector3f kRadial = new Vector3f(afCos[iR], afSin[iR], 0);                vertex[i] = kSliceCenter.add(kRadial.mult(fSliceRadius));                kNormal = vertex[i].subtract(center);                kNormal.normalize();                if (true)                    normal[i] = kNormal;                else                    normal[i] = kNormal.negate();                if (texture[0][i] == null)                    texture[0][i] = new Vector2f();                texture[0][i].x = fRadialFraction;                texture[0][i].y = 0.5f * (fZFraction + 1.0f);                i++;            }            vertex[i] = vertex[iSave];            normal[i] = normal[iSave];            if (texture[0][i] == null)                texture[0][i] = new Vector2f();            texture[0][i].x = 1.0f;            texture[0][i].y = 0.5f * (fZFraction + 1.0f);            i++;        }        // south pole        vertex[i] = (Vector3f)center.clone();        vertex[i].z-=radius;        if (true)            normal[i] = new Vector3f(0,0,-1);        else            normal[i] = new Vector3f(0,0,1);        if (texture[0][i] == null)            texture[0][i] = new Vector2f();        texture[0][i].x = 0.5f;        texture[0][i].y = 0.0f;        i++;        // north pole        vertex[i] = (Vector3f)center.clone();        vertex[i].z+=radius;        if (true)            normal[i] = new Vector3f(0,0,1);        else            normal[i] = new Vector3f(0,0,-1);        if (texture[0][i] == null)            texture[0][i] = new Vector2f();        texture[0][i].x = 0.5f;        texture[0][i].y = 1.0f;        i++;        setVertices(vertex);        setNormals(normal);        setTextures(texture[0]);    }