3D object is not planar with the ground

Hi..
i have a problem in the model result after converting .obj file into .glb and .gltf.
i have 3D mesh model with .obj format. i want to put it inside cesium. so i need to convert it first into .glb/.gltf
i have done that and it successfully converted.
when i put it inside cesium the object position is tilt like this.{https://imgur.com/6ox0pAP}
but i have checked in the sandcastle, you have the object that totally planar with the ground. {https://imgur.com/RlCukFs}

i wonder why this kind of problem happens ?
is that possible for my model to be planar like in the sandcastle example ?

i put my object inside cesium with this script

function createModel(url, height) {
    
    viewer.entities.removeAll();

    var position = Cesium.Cartesian3.fromDegrees(121.607209, 23.988376, height);
    
    var heading = Cesium.Math.toRadians(135);
    var pitch = 0;
    var roll = 0;
    var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
    var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
    
    var entity = viewer.entities.add({
        name : url,
        position : position,
        orientation : orientation,
        model : {
            uri : url
            //minimumPixelSize : 128,
            //maximumScale : 20000
        }
    });
    viewer.trackedEntity = entity;
}
    createModel('../Apps/SampleData/webodm_hualien.glb', 10.0);

This probably has to do with which axis you are using as your “up” axis. glTF treats the “Y” axis as up, so you can change your original model, or you can set var pitch = Cesium.Math.toRadians(-90); in Cesium to avert this.

Thanks,

Gabby

Hi Gabby, Thanks for your kind response…

i mean is it possible for my model to be planar like sandcastle model example without setting the the position in code ?
i have created the model with WGS84 georeference but after i convert it into glb/gltf those models cant be planar or have the correct position with the ground…

if gltf treats the Y axis as up is the case, So whenever i convert the obj file into gltf/glb, i should change the position before put it inside cesium, isnt it right ?

Hi Gabby, Thanks for your kind response..
i mean is it possible for my model to be planar like sandcastle model example without setting the the position in code ?
i have created the model with WGS84 georeference but after i convert it into glb/gltf those models cant be planar or have the correct position with the ground..
if gltf treats the Y axis as up is the case, So whenever i convert the obj file into gltf/glb, i should change the position before put it inside cesium, isnt it right ?

You can also change which axis you are treating as “up” in your original model before converting.

Thanks for your guidance Gabby.
i can know all the obj model position after i open it in Meshlab.
position orientatian in Meshlab is same with Cesium.
So, if you want to check position of the object whether correct or not in Cesium, then you just open and edit it in Meshlab.