# Rendering one 3D Tiles asset with two files VS two assets with one file each

**URL:** https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305
**Category:** CesiumJS
**Created:** [April 11, 2020, 4:14pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305 "2020-04-11T16:14:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lasselaakkonen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lasselaakkonen/32/1987_2.png) [@lasselaakkonen](https://community.cesium.com/u/lasselaakkonen)
#### Post date: [April 11, 2020, 4:14pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/1 "2020-04-11T16:14:33Z")

</div>

In Ion, I have created one 3D Tiles asset (lets call it Asset A), which contains two GLTF source files File 1 and File 2. In reality the Asset A also contains other files, but it contains at least files 1 and 2.

I have also created two other 3D Tiles assets, which each contain only one of the same files.

So I have three assets, which contain these files:

- Asset A: File 1 + File 2
- Asset B: File 1
- Asset C: File 2

I have not set a location for any of the assets in Ion.

**VIEWER 1** : When I open the hello world example for Asset A, the models from files 1 and 2 seem to be aligned correctly in relation to each other. The asset is loaded like this:

```
var viewer = new Cesium.Viewer('cesiumContainer');

var tileset = viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
        url: Cesium.IonResource.fromAssetId(ASSET_A_ID),
        modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(0, 0))
    })
);

```

**VIEWER 2** : In a separate hello world example, when I open Asset B and C in the same way, meaning I call `viewer.scene.primitives.add( ... .fromAssetId() ...)` twice, with the Asset B and C IDs, the assets are both rendered BUT the assets are aligned differently in relation to each other than in VIEWER 1.

What am I missing here? Why are the source files/models rendered in different positions in VIEWER 1 and VIEWER 2?

---

<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 13, 2020, 12:59pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/2 "2020-04-13T12:59:43Z")

</div>

Do all assets have the same options selected when you uploaded them to Cesium ion? If so, what were the upload options? (Were they tiled as `3D Model` or as `3D Capture` etc.?)

It’s possible you’re running into this issue where Cesium ion will create a new origin to normalize your geometry:

> <https://github.com/CesiumGS/cesium-ion-community/issues/282>
>
> The goal is to position a 3D Tileset on Cesium ion using the source model's origin. For example, your model may...

---

<div class="post-metadata">

### Author: ![lasselaakkonen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lasselaakkonen/32/1987_2.png) [@lasselaakkonen](https://community.cesium.com/u/lasselaakkonen)
#### Post date: [April 14, 2020, 12:20pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/3 "2020-04-14T12:20:47Z")

</div>

All assets have been uploaded with the same settings, “3D Model (tile as 3D Tiles)”. Files are GLTF models generated from IFC by IfcConvert -\> DAE -\> COLLADA2GLTF -\> GLTF.

The original issue was with real life IFC models of a building.

But here is a simplified example with SampleHouse.ifc and SampleHouseExtension.ifc from here: [https://github.com/xBimTeam/XbimSamples/tree/master/BasicCreate](https://github.com/xBimTeam/XbimSamples/tree/master/BasicCreate)

**VIEWER 3** Both SampleHouse files in a single asset:

 ![image](https://global.discourse-cdn.com/cesium/original/2X/e/ef065a3f4e78b03fc9e1c24dc22322938737f612.png)

_(… continued in next message because I am not allowed to put two images in one post …)_

---

<div class="post-metadata">

### Author: ![lasselaakkonen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lasselaakkonen/32/1987_2.png) [@lasselaakkonen](https://community.cesium.com/u/lasselaakkonen)
#### Post date: [April 14, 2020, 12:21pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/4 "2020-04-14T12:21:25Z")

</div>

**VIEWER 4** SampleHouse files as two assets with a single file in them:

 ![image](https://global.discourse-cdn.com/cesium/original/2X/c/cce5b7fdc8cd5819e68bc5ffdaa3442417900ff5.png)

I don’t know if that VIEWER 3 is even how it is intended, because it is not aligned, but anyways it is different than VIEWER 4. Why?

PS I have no idea what I am doing.

---

<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 17, 2020, 5:53pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/5 "2020-04-17T17:53:59Z")

</div>

This is happening because Cesium ion will normalize the model geometry during tiling. When you upload both models together they retain their relative positioning when this new origin is computed.

---

<div class="post-metadata">

### Author: ![lasselaakkonen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lasselaakkonen/32/1987_2.png) [@lasselaakkonen](https://community.cesium.com/u/lasselaakkonen)
#### Post date: [April 20, 2020, 2:12pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/6 "2020-04-20T14:12:10Z")

</div>

I am confused.

Uploaded models [must be in local coordinates](https://cesium.com/docs/tutorials/uploading/) and upon uploading Cesium Ion will somehow fiddle with those coordinates.

So is there any supported way of rendering two assets which have been aligned in the local coordinates? eg that house + extension OR eg some model of walls + model of pipes + model of whatever.

Is there documentation about what the “normalization” means?

---

<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 20, 2020, 5:14pm UTC](https://community.cesium.com/t/rendering-one-3d-tiles-asset-with-two-files-vs-two-assets-with-one-file-each/9305/7 "2020-04-20T17:14:39Z")

</div>

I agree that this is confusing. We have this GitHub issue open to improve this process: [https://github.com/CesiumGS/cesium-ion-community/issues/282](https://github.com/CesiumGS/cesium-ion-community/issues/282).

In the meantime what you’d need to do to get these two assets to show up in the correct position as separate assets is to use the [REST API](https://cesium.com/docs/rest-api/), which allows you to pass in a longitude/latitude/height. If you pass in the same lon/lat point for both assets, they should retain their relative positioning.
