i3dm precision question


I’m in the process of implementing an instanced 3d tile. The model I have to display needs to be placed with double precision. I’ve successfully been able to use the POSITION attribute and simply add the coordinates in the JSON feature table definition, but I’ve been wondering if I could save up space by using the POSITION_QUANTIZED attribute instead.

These are some example coordinates (cartesian WGS84 X,Y,Z):

-157931.1604355328 -4381808.169387078 4616712.155528109

-157889.74656391866 -4381854.200775967 4616682.345822607

-157874.69581631612 -4381876.47130751 4616662.231937943

I’m not entirely sure what would be the right approach to implement this. I thought I could use QUANTIZED_VOLUME_OFFSET to define a center coordinate (similar to CESIUM_RTC?) but I noticed that the spec defines QUANTIZED_VOLUME_OFFSET as float32.

Am I just going to have to keep the positions in POSITION if I need double precision?

Thank you!

I’ll also forgot to mention, if I store the positions in POSITION in the Binary Feature Table, I’m forced to use float32 (per specification). If I store the values in the JSON Feature Table, Cesium is fine reading the values as doubles.

You can definitely use QUANTIZED_VOLUME_OFFSET. It is listed as a float32 array for purposes of defining the binary format, though in most cases it will be defined in the JSON section and will be stored with double precision as you’ve noted. It is basically equivalent to CESIUM_RTC except that it defines the bottom corner.

I’m starting to think we should support an RTC_CENTER for i3dm just like we do for pnts and b3dm. That way instance positions can still be floats but defined with much greater precision as an offset from center.

Hi Sean, thank you for the reply!

Since we’re discussing the addition of RTC_CENTER in i3dm here https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/189, I think that might be the better approach.

Please let me know if there’s anything I can help with that!