Code example for FloatBuffer

Methods: positionput

0
     
    public void setVertices(float[] vertices) {
        ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
        vbb.order(ByteOrder.nativeOrder());
        mVerticesBuffer = vbb.asFloatBuffer();
        mVerticesBuffer.put(vertices);
        mVerticesBuffer.position(0);
        setNormals(); 
    } 
     
    public void setNormals() { 
 
    } 
     
    public void setVNormals(float[] vnormals) {
    	ByteBuffer vnbb = ByteBuffer.allocateDirect(vnormals.length * 4);
        vnbb.order(ByteOrder.nativeOrder());
        mVNormalsBuffer = vnbb.asFloatBuffer();
        mVNormalsBuffer.put(vnormals);
        mVNormalsBuffer.position(0);
Stop searching for code, let great code find you!  Add Codota to your java IDE