3D models support for cesium

Hii

I want to load some 3D models in cesium. I saw the “Norad Tracks Santa” demo but there is no sample code to show how to load the glTF models.

I have following questions.

  1. Is there some sample code to show how to load glTF models in cesium ?

  2. Does cesium supports any other 3D format like collada, .3ds, .max any ?

  3. I have .3ds models. Have you tried the .3ds->collada->glTF pipeline. I mean if you follow this, will my .3ds models work in cesium.

Thanks

Pankaj Bansal

1 there is a glTF branch on github, easy to find. you can find several glTF model files on "Apps/CesiumViewer2/Gallery" folder. load czml files in that folder, you can see sample model displayed in the scene。
2 Cesium only support glTF format, and only collada files can be convert to glTF, via collada2glTF tool. other file must be converted to collada at first.
3 don't try yet, but believe the pipeline will be work fine. Collada and glTF spec support the contents in 3ds. looking forward to hear about your test!

Also see https://groups.google.com/forum/#!topic/cesium-dev/soK05NfUuM8

Patrick

As Pankaj asked, I have glTF models but i am not able to load in Cesium. Can someone provide me some sample code which is loading glTF model in Cesium.

thanks,

mohan

In the glTF branch, see CesiumViewer2.js. This is under heavy development right now so expect some small breaking changes in the next few weeks.

Patrick

Hi Patrick,

Thanks for such a kind support. As per your comment, I am able to load 3d model but only those which are in sample models in glTF project at gitHub. But I am

not able to load my own model. I have downloaded a 3d model of dubai hotel. Can you please check that what is problem with that. And provide me any other model

other than glTf’s project if possible.

link for 3d model is http://sketchup.google.com/3dwarehouse/details?mid=8bd19f4a119ec1b9c96a646c5f2af8d0&prevstart=0

Hello guys,

I am also getting the same issue. I am able to load models from glTF gallery. But not able to load our models.

I have also downloaded a model from Google warehouse. the link is: http://sketchup.google.com/3dwarehouse/details?mid=9e997b501e1a43d7d810b14a81e12eca

I have convert it into glTF format. It is converted successfully, but not showing model in cesium. It is also not showing any error.

Please help.

Pankaj,

This model (http://sketchup.google.com/3dwarehouse/details?mid=8bd19f4a119ec1b9c96a646c5f2af8d0&prevstart=0) is not valid COLLADA. I attached what the default Mac preview provides.

If you are on Mac, you can open it in Xcode and then save it, and it will convert to glTF and load in Cesium OK. You might also be able to re-export form SketchUp. If there are a lot of models like this, consider submitting an issue to the converter to add workarounds for these models: https://github.com/KhronosGroup/glTF/issues?direction=desc&labels=coming-next&sort=updated&state=open

Patrick

Manish,

For that model (http://sketchup.google.com/3dwarehouse/details?mid=9e997b501e1a43d7d810b14a81e12eca), I downloaded the SketchUp version, exported it to COLLADA, and then converted it to glTF. It mostly rendered OK, but there are still some known converter issues:

$ collada2gltf -f model.dae

converting:model.dae … as model.json

WARNING: some primitives failed to convert

Currently supported are TRIANGLES, POLYLIST and POLYGONS

More: https://github.com/KhronosGroup/glTF/issues/129

and https://github.com/KhronosGroup/glTF/issues/135

[geometry] 72096 bytes

[animations] 0 bytes

[scene] total bytes:72096

[completed conversion]

Runtime: 0.03 seconds

You are welcome to express your interest in those converter issues on github.

Patrick

Hi guis, I have a problem with open gltf model.
My app is based to cesiumjs and C#, at this moment Visual Studio create virtual sever to acces the web site included to my project from where C# webview load cesium. My problem is in to load 3d model I can't find file. 3dmodel.gltf is in directory where is my index.html, I load model in cesium with url:'./model.gltf'.
Thank you

when I try to execute my program response this error :

RuntimeError: Failed to load external gltf: ./model.gltf
Error
    at new t (http://localhost:7556/Build/Cesium/Cesium.js:379:6741)
    at http://localhost:7556/Build/Cesium/Cesium.js:401:30029
    at Object.then (http://localhost:7556/Build/Cesium/Cesium.js:378:3023)
    at http://localhost:7556/Build/Cesium/Cesium.js:378:3501
    at f (http://localhost:7556/Build/Cesium/Cesium.js:378:4883)
    at m (http://localhost:7556/Build/Cesium/Cesium.js:378:3637)
    at n (http://localhost:7556/Build/Cesium/Cesium.js:378:3161)
    at Object.then (http://localhost:7556/Build/Cesium/Cesium.js:378:3023)
    at http://localhost:7556/Build/Cesium/Cesium.js:378:3511
    at f (http://localhost:7556/Build/Cesium/Cesium.js:378:4883)