public FloatBuffer writeVertexArray(FloatBuffer store, Vector3f scale, boolean center) {

        if (store!=null){
            if (store.remaining() < width*height*3)
                throw new BufferUnderflowException();
        }else{
            store = BufferUtils.createFloatBuffer(width*height*3);
        }

        assert hdata.length == height*width;

        Vector3f offset = new Vector3f(-getWidth() * scale.x * 0.5f,
                                       0,
                                       -getWidth() * scale.z * 0.5f);
        if (!center)
            offset.zero();

        int i = 0;
        for (int z = 0; z < height; z++){
            for (int x = 0; x < width; x++){
                store.put( x*scale.x + offset.x );
                store.put( hdata[i++]*scale.y );
                store.put( z*scale.z + offset.z );
            }
        }

        return store;
    }
Creates a vertex array from the height data in this Geomap

The scale argument specifies the scale to use for the vertex buffer.
For example, if scale is 10,1,10, then the greatest X value is getWidth()*10

@param store A preallocated FloatBuffer where to store the data (optional), 
size must be &gt;= getWidth()*getHeight()*3
@param scale Created vertexes are scaled by this vector

@return store, or a new FloatBuffer if store is null

@throws NullPointerException If isLoaded() is false
jme3-terrain/src/main/java/com/jme3/terrain/GeoMap.java