public Triangle(){
  ByteBuffer bb=ByteBuffer.allocateDirect(triangleCoords.length * 4);
  bb.order(ByteOrder.nativeOrder());
  vertexBuffer=bb.asFloatBuffer();
  vertexBuffer.put(triangleCoords);
  vertexBuffer.position(0);
}

public Triangle ( ) { ByteBuffer bb = ByteBuffer . allocateDirect ( triangleCoords . length * 4 ) ; bb . order ( ByteOrder . nativeOrder ( ) ) ; vertexBuffer = bb . asFloatBuffer ( ) ; vertexBuffer . put ( triangleCoords ) ; vertexBuffer . position ( 0 ) ; }
sets up the drawing object data for use in an opengl es context .
