Easy adjustment for model orientations and positions

Is there an easy fix/adjustment that can be made for multiple models that are used so that the orientation is correct? My quick fix is to do a check on each model being used and add or subtract degrees in the orientation field. But as the amount of models increases, I don’t want to have to make a check for every specific model.

For example in the image below, I added this paper airplane model to my code and its orientation is off and it position is off. The model should be centered on the circle and oriented west. The blue line is the polyline trail following the aircraft. If I add the Cesium aircraft, the position is correct (center of the colored circle) but the orientation is off by 90 degrees. There are other models I use where the orientation is correct.

You should re-aligned 3d model using blender or Windows 10 3D Builder.

Or you can set its Transformation by code something like:

var heading = Cesium.Math.toRadians(xrotate);
var pitch = Cesium.Math.toRadians(yrotate);
var roll = Cesium.Math.toRadians(zrotate);
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(entity.position, hpr);

Translation:

entity.position = Cesium.Matrix4.multiplyByPoint(Cesium.Transforms.eastNorthUpToFixedFrame(entity.position),
 new Cesium.Cartesian3(offsetx, offsety, offsetz), new Cesium.Cartesian3());

Scale:

entity.model.scale = scaleValue;

  • Best Regards

So, it seems like the best option is to adjust each model.

Can .glb and .gltf files be adjusted using Blender or 3D Builder?

It should be possible to open glTF/GLB files with Blender, adjust the transform, and write them back into files.

But note that glTF defines the concept of a “forward axis”, as of glTF™ 2.0 Specification . It’s not entirely clear whether your model is “right” or “wrong” in this regard, or whether it will become “wrong” or “right” by modifying it…

And an aside: You could probably also modify the model with GitHub - donmccurdy/glTF-Transform: glTF 2.0 SDK for JavaScript, TypeScript, and Node.js. (maybe even with the command line interface). I’d have to take a look at the syntax details. But it might particularly make sense if you have many models and they all require the same transformation: Then you could probably just modify the models in one run, with a shell script/batch file.