Access to 3D model hierarchy - nodeTransformations

Is there anyway to access the children of a 3D model? The animations are clearly doing this in some manner, but that may be a case where the animation data or reference is stored in the file format. What if I wanted set the rotation of the turret of a tank? That wouldn’t be an animations, but rotations applied to child nodes of a model. I see the entityCollection has a list of entities, but I don’t really see a way to navigate through that collection to find the sub nodes of the model to set the rotation. It appears this ability is setup through nodeTransformations which is a associative array based upon the names. I guess I just need to look through the model file to find the node names? I know that the model loading has changed to a binary format, which means I need to have the source file to find those node names? Is there a way to find those node names from the object returned from the scene.pick function?

Scott

Hello Scott,

This demo may be helpful for you: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=development/3D%20Models%20Node%20Explorer.html&label=Development

All the available nodes are added to a list on line 96: Object.keys(model._runtime.nodesByName)…

If you look at line 113, you can see how to set the node.matrix of the selected node to apply the transform

Best,

Hannah

1 Like