3D model orientation

Hello,

I am working with an STK v12-generated CZML of a multi-stage rocket. I got the models integrated into the cesium file, but as shown in the attached screenshot (which shows the rocket, trailing trajectory, and one of the stages falling away), the models are all rotated 90°. How do I fix this?

What was the original source of this model? Was it a Collada model? The Collada spec allows models to define the “up” direction to be any of the xyz axes. glTF always defines the y-axis to be the up direction. This can lead to inconsistencies in the exported quaternion if you have a Collada model in STK and a glTF model in Cesium. Try using the glTF model in STK and re-export the scenario to CZML.

The models are .glb files produced in blender.

I suspect I might have to edit the quaternions, but I’m trying to making sure there isn’t an easier way to do this, because I really don’t want to learn quaternions within the schedule I have for this project.

Were the same models used for both STK and Cesium? Did the models load with the correct orientation in STK, or did you have to set manual rotations inside of STK to get them oriented correctly?

Ah, sorry, I forgot to mention that.

Yes, the same models were used in both STK and Cesium. However, in STK, the models required a 90° rotational offset on the Y axis.

My colleague (who made the Blender models) has told me that model orientation is agnostic in Blender, though he’s also going to look to see if there is something he can do.

Blender model orientation isn’t actually agnostic. If you look at the orthographic views (numpad 7 for top view, numpad 1 for front view, and numpad 3 for right view), you can see that the -Y (negative Y) axis is considered the “front” of the model, and +Z is up. When exporting to glTF, Blender automatically applies a 90 degree rotation, such that the model’s “up” changes from Blender +Z to glTF +Y, and the model’s front changes from Blender’s -Y to glTF’s +Z. STK expects these conventions to be followed, and will adapt the model again to STK’s internal coordinate system.

Rockets are an interesting case for orientation. Often such models are artistically displayed with the tip of the vehicle pointing “up”, as if it were standing on the pad, ready for some kind of vertical launch. But this is NOT what STK wants. STK thinks the direction of travel is the “front” of the vehicle, regardless if it’s flying horizontal or vertical or somewhere in between.

So in Blender, when modeling a rocket, you draw it on its side, as if flying horizontally towards Blender’s “front” -Y axis. When exported to glTF, this becomes glTF’s front axis of +Z, and then when STK imports a glTF, STK adapts it to STK’s front axis of +X, and the rocket flies in that direction. Ideally this should be carried through CZML and fly on this axis in Cesium as well.

One possible wrinkle here, STK allows arbitrary model orientations to be specified in the 3D object properties panel. I don’t know offhand whether these orientations are applied to the CZML or not. If not, that could be the cause of the orientation discrepancy you’re seeing here.

Try modifying the Blender model to fly towards Blender’s -Y axis, and re-export your glTF from there. That should let you clear out any model orientation values you have set in STK.

1 Like

Thank you, I will pass this on to my colleague. He actually managed to figure something out yesterday that did what we needed, but he will probably find this useful nonetheless.