# i3dm precision question

**URL:** <https://community.cesium.com/t/i3dm-precision-question/5256>\
**Category:** CesiumJS\
**Created:** [March 7, 2017, 3:06pm UTC](https://community.cesium.com/t/i3dm-precision-question/5256 "2017-03-07T15:06:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piero\_Toffanin](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@Piero\_Toffanin](https://community.cesium.com/u/Piero_Toffanin)\
**Post date:** [March 7, 2017, 3:06pm UTC](https://community.cesium.com/t/i3dm-precision-question/5256/1 "2017-03-07T15:06:26Z")

</div>

Hello,

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!

---

<div class="post-metadata">

**Author:** ![Piero\_Toffanin](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@Piero\_Toffanin](https://community.cesium.com/u/Piero_Toffanin)\
**Post date:** [March 7, 2017, 4:42pm UTC](https://community.cesium.com/t/i3dm-precision-question/5256/2 "2017-03-07T16:42:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [March 7, 2017, 11:58pm UTC](https://community.cesium.com/t/i3dm-precision-question/5256/3 "2017-03-07T23:58:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Piero\_Toffanin](https://avatars.discourse-cdn.com/v4/letter/p/cc9497/32.png) [@Piero\_Toffanin](https://community.cesium.com/u/Piero_Toffanin)\
**Post date:** [March 9, 2017, 3:14am UTC](https://community.cesium.com/t/i3dm-precision-question/5256/4 "2017-03-09T03:14:50Z")

</div>

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](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!
