public static FloatBuffer allocateFloatBuffer(float[] coords){
  ByteBuffer byteBuffer=ByteBuffer.allocateDirect(coords.length * BYTES_PER_FLOAT);
  byteBuffer.order(ByteOrder.nativeOrder());
  FloatBuffer floatBuffer=byteBuffer.asFloatBuffer();
  floatBuffer.put(coords);
  floatBuffer.position(0);
  return floatBuffer;
}

public static FloatBuffer allocateFloatBuffer ( float [ ] coords ) { ByteBuffer byteBuffer = ByteBuffer . allocateDirect ( coords . length * BYTES_PER_FLOAT ) ; byteBuffer . order ( ByteOrder . nativeOrder ( ) ) ; FloatBuffer floatBuffer = byteBuffer . asFloatBuffer ( ) ; floatBuffer . put ( coords ) ; floatBuffer . position ( 0 ) ; return floatBuffer ; }
creates a direct float buffer , and copy coords into it .
