Hi,
my issue regards GLTFLoader.js, and the way a vertice is read in a triangle. My final goal is to make the importer to import animated vertices (not through bones and skinning, nor through ShapeKeys, just plain vertices animation) because it is not supported in Blender (see my question ⚓ T102956 Exporting to GLTF: Can not export keyframes using AnimAll for a single vertice) and also (I guess) in Three.js, but it is useful when you want to visualize structural analysis results from CAE software in C++ memory.
For the sake of simplicity let as assume that I have a triangle that consists of 3 points, all at 0 (origin).
triangleBuffer.gltf (1.6 KB)
Thus we have
3 points x 3 coordinates x 4 bytes = 36 bytes.
When I console.log the ArrayBuffer for the Vertices of this triangle (L3120 for GLTFLoader.js):
} else {
console.log(bufferView);
array = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize );
}
I am always getting -128 for the 4th byte of the z coordinate instead of 0. See below
Do you know why this happens ? -128 is an alternative of 0 ? Is that a bug of FileReader? It will be better to have 0 for better understanding.
Another question is that since each float is 1 byte = 0 up to 255, how an Int8 can be from -255 to 255 ? Where is the ± sign stored?
Best, and sorry for the encyclopedic questions,
Dimitrios Ververidis