Loading 3d-tileset in Unity

Hi, all

I have been experimenting with importing 3d-tilesets into unity and have encountered the following:

1. A concise explanation of the problem you're experiencing.

My tileset.json does not contain any transforms, the only spatial information regarding the placement of the tiles is the RTC_CENTER in the feature Table of each b3dm.
Now, while the translation (using the rtc) of each tile seems correct (in relation to each other), rotation does not. (See image attached). Now I am wondering what am I missing? Do I have to take the curvature of the earth into account? e.g. do I have to transform using WSG84 or something?

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

Sounds like a very cool project! Will this be open source? I do know there is an unofficial partial 3D Tiles implementation in Unity here that you might find helpful: https://github.com/NASA-AMMOS/Unity3DTiles . I haven’t used it myself, so I’d be curious about its performance as well.

For getting the orientation right, I think unless the tiles specify some kind of transform (https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#transforms) then the orientation is engine defined. The spec says it’s often expected to be WGS 84 earth-centered, earth-fixed (ECEF) reference frame (EPSG 4979) but it need not be.

How was this tileset created? How does it look in CesiumJS?

Hi Omar. Checked this NASA project you have been mentioning several times but we don’t seem to see in the Cesium docs how to get a b3dm url for a specific Cesium dataset. Is cesium exporting such format? Is that done through the API may be? We are interested in using Cesium to upload models and then to stream that data to Unity, is that possible and if so how do we get the b3dm or i3dm url? Sorry for the newbie question

We don’t have an official Unity integration at the moment, but if you are interested in streaming 3D Tiles to other clients you’ll want to use the Cesium ion REST API: https://cesium.com/docs/rest-api/

You first make a request to the asset: https://cesium.com/docs/rest-api/#operation/getAssetEndpoint

This gives you a new token and a URL you can use to access the tiles. The tileset.json is the entry point for 3D Tiles which lists all the individual tiles (the b3dm’s for example). You may find the 3D Tiles Overview helpful here too: https://github.com/CesiumGS/3d-tiles/tree/master/overview#3d-tiles-overview

Thanks @omer Iam using the Rest Api inside of Unity and as per your instructions I am getting the responce url : https://assets.cesium.com/96188/tileset.json?v=1
And a Acess tokken But the respoce is Not parsable
{“asset”:{“version”:“1.0”,“tilesetVersion”:“fe145fc0-9a0a-11ea-b465-473962fcc992”,“extras”:{“ion”:{“defaultStyle”:{“color”:“Boolean({feature['cesium#color']}) ? color({feature[‘cesium#color’]}) : color(’#ffffff’)”},“terrainId”:1,“georeferenced”:true,“movable”:false}}},“properties”:{“elementType”:{},“elementId”:{},“cesium#color”:{},“cesium#estimatedHeight”:{“maximum”:1100,“minimum”:-31.000000000614524},“building”:{},“shop”:{},“source”:{},“name”:{},“wheelchair”:{},“access”:{}},“extensionsUsed”:[“3DTILES_batch_table_hierarchy”],“geometricError”:154134.67955991725,“root”:{“geometricError”:77067.33977995862,“boundingVolume”:{“region”:[-3.141457994456685,-1.4831730578095488,3.140539464323275,1.4403465997204372,-385.0565011513918,5967.300616082603]},“content”:{“uri”:“root.b3dm”},“children”:[{“geometricError”:38533.66988997931,“boundingVolume”:{“region”:[-3.141457994456685,-1.4831730578095488,0.00003870965747998223,1.4403465997204372,-165.10238794752343,5915.2067650589615]},“content”:{“uri”:“0-0-0.json”}},{“geometricError”:77067.33977995862,“boundingVolume”:{“region”:[-0.00003125012025695847,-1.4035456116211558,3.140539464323275,1.4103802179975395,-385.0565011513918,5967.300616082603]},“content”:{“uri”:“0-1-0.json”}}],“refine”:“ADD”}}

This is mainly because the response Json has #Color in class name when i convert it to a C# class inside Unity its Not working However i am able to get a response inside of Postman

The #color being part of the string returns in is valid JSON. I’d make sure you’re correctly parsing the JSON on the Unity side, (and verify that the response you’re getting is indeed a valid JSON with: https://jsonlint.com/).

Hey Omar i tested it out and the issue is i cant seem to make sense of Default Style Node inside of Unity

@omar How Can I get The 3d Tileset Files Example 3dm Files From Rest API Can you be more precise
image|602x499

The default style is used by Cesium ion, to apply it using the 3D Tiles styling language. You can see how it’s used by opening a code example of the Cesium OSM Buildings.

You were able to get the tileset.json, right? That includes a hierarchy of tiles, and each tile has a content URL of where to request the b3dm/i3dm/pnts tile. So you should use that URL to request the tiles.

Hi @omar Thanks For the responce the issue might be something trivial but i am Getting the file inside Postman But when i Download it from Unity i get weired String instead of Json FIle

The files served from Cesium ion are gzipped, so you’ll have to unzip before you can use it.