Models versus Billboards; question about usage

Cesium Team,

We render a large number of Billboards via CZML wherein the Billboard image is provided via the texture atlas. From CZML we are able to specify scale, label, and position information (etc.).

Although I have read the tutorial on 3D models, investigated the Sandcastle examples, and run a simple test to include a 3D model into our scene, I’m not completely putting together how we would use these models instead of Billboards.

I would assume that the CZML we are using does not have to change except for the “billboard” attribute. In its place, do we specify “model” instead? If so, can we add 3D models to a texture atlas of sorts and specify the index via CZML? Furthermore, the 3D model examples I’ve seen appear to handle scaling by distance automatically. Is this true? Right now we are using a NearFarScalar to scale our Billboards.

Thanks for any hints or suggestions that might help put the pieces together.

Appreciate it,

Chris

Just to clarify; I’ve attempted to load the models via CZML and I can see that the models are being returned (validated through DevTools - Network tab) but the models are not being displayed on the globe.

CZML snippet for “model” section only; position, labels, etc. are all working correctly.

“model”: {

“gltf”: <path to model - this works>,

“scale”: 10.0,

“show”: true

}

Is there something I am missing? I noticed in the non-CZML examples for 3D models that the developer supplies a “modelMatrix”. I tried adding this via CZML and using the same cartesian used for the “position” points to no avail.

Thank you.

Chris,

If you use the Cesium API directly, do you have the same problem? If so, see the troubleshooting section of the models tutorial: http://cesiumjs.org/2014/03/03/Cesium-3D-Models-Tutorial/

Patrick

Patrick,

The models are working correctly when used via API. When used via CZML, the model is clearly being loaded (JSON, images, shader files) but it’s simply not appearing on the globe.

Thanks.

Can you share more of your CZML? I tried a very simple example and the model loads. Orientation is controlled by the “orientation” czml property parallel to “position”. In this example I omitted it, so it defaults to the identity.

There is no “modelMatrix” CZML property. “position” and “orientation” are each evaluated and combined into the modelMatrix by the visualizer.

Paste into http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Cesium%20Viewer%20Widget.html&label=Showcases

require([‘Cesium’], function(Cesium) {

“use strict”;

var builtInCzml = [{

“id” : “Vehicle”,

“availability” : “2012-08-04T16:00:00Z/2012-08-04T17:04:54.9962195740191Z”,

“model” : {

“gltf” : ‘…/models/CesiumGround/Cesium_Ground.json’,

“scale” : 10000

},

“position” : {

“interpolationAlgorithm” : “LAGRANGE”,

“interpolationDegree” : 1,

“epoch” : “2012-08-04T16:00:00Z”,

// Trimmed to just 2 points

“cartesian” : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,

3894.996219574019, -2291336.52323822, -4682359.21232197, 3662718.52171165]

}

}];

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.extend(Cesium.viewerDynamicObjectMixin);

var czmlDataSource = new Cesium.CzmlDataSource();

czmlDataSource.load(builtInCzml, ‘Built-in CZML’);

viewer.dataSources.add(czmlDataSource);

// Zoom in a little closer…

var rectangle = new Cesium.Rectangle(-2.056, 0.587, -2.010, 0.633);

viewer.scene.camera.viewRectangle(rectangle);

Sandcastle.finishedLoading();

});