This repository has been archived by the owner on Aug 14, 2022. It is now read-only.
Is this information still relevant? #34
Comments
I am trying to do the same in C#. Maybe proto files in the repository are not the same as those used in js? |
The proto in this repo is incomplete; here is one with more detail which only lacks NodeData field 8. The vertices byte array straight from the proto (field 1) is a multiple of 3; it only contains XYZ. A vertex buffer is created with a count divisible by 8 from XYZ, UV (field 7) and layer/octant-counts (field 8). XYZ processing works ~ like this: var count = input.length / 3;
var output = new Uint8Array(8 * count);
for (var i = 0, axis = 0; axis < 3; axis++) {
for (var j = 0, d = 0; j < count; j++) {
d = (d + input[i++]) & 0xFF;
output[8 * j + axis] = d;
}
} Unfortunately I didn't have time yet to make this stuff transparent. |
Many thanks! This is exactly what I was missing. From README.md it seemed that XYZWUUVV was exactly the format of the vertices field. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried to decode the mesh using the information from Readme.md, as well as dump_obj.js, but nothing worked. It seems to me that during this time, the layout of the mesh vertices has changed.
I've tried node https://kh.google.com/rt/earth/NodeData/pb=!1m2!1s214272516372616353!2u852!2e1!4b0
There are 3 mesh in this file. Each of them contains 18744, 3678 and 1809 bytes of vertices. Second and third not even a multiple of 8.
The text was updated successfully, but these errors were encountered: