# Imprecise 3D Tile rendering coordinates

**URL:** https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432
**Category:** CesiumJS
**Created:** [April 24, 2020, 8:46am UTC](https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432 "2020-04-24T08:46:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anaezes](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/anaezes/32/1987_2.png) [@anaezes](https://community.cesium.com/u/anaezes)
#### Post date: [April 24, 2020, 8:46am UTC](https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432/1 "2020-04-24T08:46:55Z")

</div>

Hello,

I am developing an application in which I need to render 3Dtiles according to the position of a vehicle in real time.  
I converted the tifs from EPSG:4326 to tifs ESPG:3857 with GDAL wrap, converted the tifs to .obj with blender and blender-gis and checked that the pivot is in the center. With GDAL, I checked the geographic center of each tif and then placed each asset / tile in its respective location. However, as you can see in the image, they are superimposed.

I am using Cesium ION to save the tiles and I tried in different ways to render them:

1st I adjusted the position (lat, lon) in Cesium ION. It did not work.  
2nd I did not adjust the location in the ION and defined it in real time from a JSON. It did not work.  
3rd I used the center of the first rendered tile as a reference, and calculated the position of the others in relation to this one (adding the width or length to the point respectively). It did not work.

I leave attached a print with a demonstration of the error happening.  
I checked and the coordinates given to each tile are 3768.08 m apart, which should be the value to be side by side and not overlap. The error is about 30%.

Can someone help me solve this problem?

[Code example](https://sandcastle.cesium.com/#c=vVRdb9owFP0rFk+J1JqGb1ZarQWKghoYbUqhijSZ5AIOjk1th49O/e9zSNu13aQ9TFoeolzfc86998R2sYh6knCN2qBomvRvEQlDUAppgfYilYgKjohSoFXAcwx2BccRzEnK9MUB7IsVcHSGggLs+8tZL6RD2nfvnlxnQF3l8ptq2HZr7mo9Gbf7TWxAj1FvlYFWw944mfqXidd2Yq/Tj6/9UdXzR3rqj7YP1IkH8Xg19MO9iU+8uEuv2/31gxHzYm838FdGfBDPypcs3Lu1e1M8LLsZhk/3/SjDTicjOoy7zrDjVjy/ezKIL5u4MeuU6PJ+Mht968aPw1p7UG9OOg/HwpfT+tK5rYpGSv3vepPeBYXTgAd8QyTaUNiCNGNy2L7YhceHNSsohIe4LbgmlIMMCnbOO+SxCoEDXjAxA6yWYmtE5oQpOH1DwE4Dj6wX2XwxD8odnzIwg6o1hFpIj+4ot9+60lkStFH8UGstaUI13YDCJIqsgKP3bX9QBm39yPIIpZJ9Qb9+8g0oswNCwHMpkotsD7iR1SzVTsr2UU5IRATMI1rS3RvRN9tJzYVMFAai9EBIvbxb++KK7iC6kiQBKydnz2s/RGrzRXj5UKsDCwmgrOMGblQqlWazdoQqDq426iWnUTpCjp038GwHvztR+q9WVF6t+Gcz/mpFvdl0TMmPVpzY9icn8tGfhEh8Yb14YmOhlyC3VIE1T3mos1NtgZRC2ugwcSi4EgwwE4uXdaP2nL0KR4WW0nsG5xnuK03WZojMHwvjooZkzYhpuDhLwxVoHCqVkVrFV0orohtEo7M/HBEUMnOzmMw8ZeyWPkFQOG8VDf4DjQkSUb4YbkAysjeQrI3W0jm/zhMY41bRhFnRz1wtBJsR+U73Jw)

 ![tiles](https://global.discourse-cdn.com/cesium/original/2X/0/03804ce6b55a44cea9d0686a21e43c74b49f857e.jpeg)

---

<div class="post-metadata">

### Author: ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)
#### Post date: [April 24, 2020, 3:48pm UTC](https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432/2 "2020-04-24T15:48:53Z")

</div>

What does your TIFF represent? Is it terrain or a digital surface model? Is this surface itself supposed to move along with a vehicle?

I added toggle buttons to each tileset to make it easier to see [in your Sandcastle example](https://sandcastle.cesium.com/#c=vVRdb9owFP0rHi9LJGYavgobq7ZCWwU1MNa0K1WkyTgXcHBsajt8dNp/n0Oga7tJe9i0POX6nnvOvcc3qVTQhSLCoC5olqX9K0QoBa2RkWgrM4WYFIhoDUZHosBgXwocw5Rk3HzcgUO5AIHeo6gE2/58ckHZkPX96wffGzBf++Jzg3b9pr9Y3t50+21sQffxxSIHLYYXN+k4PE2DrpcEvX5yGY4aQTgy43C0vmNeMkhuFsOQbm18FCRn7LLbX95ZsiAJNoNwYckHyaR2yunWb36x4rTm5xgx3vbjHDu+HbFhcuYNe349CM+OBslpG7cmvSqbf7mdjD6dJffDZndw3L7t3b2RoRofz72rhmxlLPxqVtl1VHoXiUisiEIrBmtQdkwB671d+GZ35kQluou7UhjCBKio5BZ1uzzWFATgGZcTwHou15ZkSriGd48I2BgQsbOnLQ6LoNYLGQc7qF4CNVIFbMOE+9iVyZNgLOMzraViKTNsBRqTOHYigZ62/YwZjPMtzyOUKf4W/bzkz6DtBlDAUyXTj/kO+LHTrjaPam65KEhlDDwgRrHNY2Fo10lPpUo1BqLNQCozv16G8pxtID5XJAWnKM6fQz9EGftGRG2n1YOZAtDOmxZu1ev1drtZRnUPN1rHVa9VLSPPLRr47ka/OlH9r1bUD1b8tRl/tOK43fas5HMrjlz3hRPF6A9SpqF09p64WJo5qDXT4EwzQU3+VTuglFQu2k1MpdCSA+Zytj+3bN8LykhcERFT278FWAtDKfmEqNPMGCmc16GczTgc7Pdel9FBwnH3bu5zh91/9TT+qfOPVKovZapPdErlUkebLYeTvOYDS5f2SvLbdjCuGEiXnFj7K5OMLmx/VOu8tU7lUNKJ2Qqx+P1vPnhEuf1P2sw04/yKPUBUOulULP5ZGZckZmI2XIHiZGsheRuduXdyWSQwxp2KDXPRl7WmcOQJ7w8).

Is the goal just to have these two tilesets side by side with no overlap?

---

<div class="post-metadata">

### Author: ![anaezes](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/anaezes/32/1987_2.png) [@anaezes](https://community.cesium.com/u/anaezes)
#### Post date: [April 24, 2020, 4:28pm UTC](https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432/3 "2020-04-24T16:28:28Z")

</div>

Hi, thanks for answering.

They are tifs of the bottom of the sea with bathymetry which I converted to .obj in blender. I tried to do the rendering with terrain files instead but because they are underwater (and the vehicle) I was not able to, so I’m using obj instead.

I have the lat/lon coordinates of the center where the obj pivot is supposed to be (It looks like it on cesium ion) and use this to render the tiles. In the example I gave they are meant to be side by side without overlap. I calculated the distances between centers and there should be no overlap.

This are the [files](https://drive.google.com/open?id=1Tz71jCYaM98kARp7sogoddroR2ATYrrb) I used in the example.

---

<div class="post-metadata">

### Author: ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)
#### Post date: [May 5, 2020, 2:10pm UTC](https://community.cesium.com/t/imprecise-3d-tile-rendering-coordinates/9432/4 "2020-05-05T14:10:42Z")

</div>

Thanks for sharing the files @anaezes. I believe the issue you’re running into here is that Cesium ion will renormalize the model geometry when tiling. This is described here: [https://github.com/CesiumGS/cesium-ion-community/issues/282](https://github.com/CesiumGS/cesium-ion-community/issues/282).

Once that is fixed your approach should work. In the meantime, I think the only way to do this correctly would be to use the REST API to pass in a longitude, latitude while uploading, so that the model origin is correctly placed there.

Other than that, I am curious to hear why the underwater terrain files didn’t work. Did you try uploading a GeoTIFF version of these to Cesium ion? If so, do you have the asset IDs for that? I can take a look at that - that may be an easier way to get it to work.
