Open SteveSmith16384 opened 4 years ago
Hi, it's a very useful library, thanks for providing it. I just found a few things that might catch others out through:
To get the colour index, you need to convert it from unsigned, e.g.:- int colour_id = voxel.getColourIndex() & 0xff;
int colour_id = voxel.getColourIndex() & 0xff;
I also needed to reverse the hex string that I got from the pallette, since it seems to be BGR, e.g.:-
String hexColor = String.format("#%06X", (colour & 0xFFFFFF)); // Wrong way round String hexColor_rev = "#" + hexColor.substring(5) + hexColor.substring(3, 5) + hexColor.substring(1, 3);
Also, the y and z co-ords seem to be reversed, e.g. z (depth) is y (height) and y is z.
Cheers, Steve
Thanks @SteveSmith16384! I've just noticed this post after banging my head on trying to get VOX models into LibGDX.
Hi, it's a very useful library, thanks for providing it. I just found a few things that might catch others out through:
To get the colour index, you need to convert it from unsigned, e.g.:-
int colour_id = voxel.getColourIndex() & 0xff;
I also needed to reverse the hex string that I got from the pallette, since it seems to be BGR, e.g.:-
Also, the y and z co-ords seem to be reversed, e.g. z (depth) is y (height) and y is z.
Cheers, Steve