2

I try loading a model from a .glb file (Blender)

doing the following:

        private FloatBuffer bufferXYZ;
        ByteBuffer glb_bb;
    ...
        byte[] bytes = new byte[vertexXYZ_BufferLen];
        glb_bb.get(bytes, 0, bytes.length);
        ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.length).order(ByteOrder.nativeOrder());
        buffer.position(0);
        buffer.put(bytes);
        bufferXYZ = buffer.asFloatBuffer();
        buffer.rewind(); 
        bufferXYZ = ((ByteBuffer) buffer.rewind()).asFloatBuffer();

but I can’t get the correct coordinates in bufferXYZ

and something similar to the coordinates can only be obtained by sorting ByteOrder.BIG_ENDIAN (the documentation says LITTLE_ENDIAN)

how to correctly load a BIN section into a Floatbuffer for OpenGLES20

Chego
  • 135
  • 9

1 Answers1

0

Thanks understood. it was necessary to shift the starting point of reading even after the word BIN.

Chego
  • 135
  • 9