I studied the Cesium - Sandcastle - 3D Models Node Explorer Example, recommended by Hannah Pinkos February 2, 2016.
I created a model using SketchUp 2017. I exported the model (options: Triangulate All Faces, Preserve Component Hierarchies, Export Texture Maps) producing the file Chevron.dae.
Next, I used COLLADA|OBJ to GLTF converter to convert Chevron.dae to Chevron.gltf.
Next I create an entity with a model attribute:
var entity = viewer.entities.add({
name : url,
position : position,
model : {
uri : "../model/Chevron.gltf",
nodeTransformations : {
node_1 : {
translation : Cesium.Cartesian3(10.0, 0.0, 0.0)
}
}
}
});
In my entity creation, I call node_1 (from the list of nodes found in Chevron.gltf) and I want to translate it. As you can see in my example. I am moving its x position. It does not affect my model’s position.
When I switch the uri with one of the samples provided (Cesium_Man) and use any of the nodes (i.e. Armature). I see the affect that my translation has on that model.
var entity = viewer.entities.add({
name : url,
position : position,
model : {
uri : "../model/CesiumMan/Cesium_Man.gltf",
nodeTransformations : {
Armature : {
translation : Cesium.Cartesian3(10.0, 0.0, 0.0)
}
}
}
});
I suspect that I am not exporting the SketchUp correctly, or I am not calling the node in my gltf correctly, or my dae/gltf file is missing attributes.
Can you help me solve this problem?
P.S. When I get this solved, I would love to contribute an example of using nodeTransformations. I did a lot of Google Searching and there was no direct examples of its usage.
Chevron.dae (5.62 KB)
Chevron.gltf (6.54 KB)
Chevron.skp (79.8 KB)