can't see my gltf model

Hi!

I am using the code from Cesium-3D-Models-Tutorial to load my gltf model.

If I use northEastDownToFixedFrame

var modelMatrix = Cesium.Transforms.northEastDownToFixedFrame(

Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 24) // the height is 24 meters

);

I see the model rotated 180 degrees around a horizontal axis (i.e. the bottom of the building is above its top).

If I substitute northEastDownToFixedFrame for northEastUpToFixedFrame and preserve everything else intact, I can’t see my model at all.

My gltf model can be found here:

https://docs.google.com/uc?authuser=0&id=0B0zBe2BfoXGyZ0U1Q1FoUjVLcEU&export=download

Maybe I am missing something obvious.

Please help to see my model correctly placed.

Thanks in advance,

Vladimir

Hi,

If you use eastNorthUpToFixedFrame and height = 0 the model will be above ground and with the right rotation. Check it out in sandcaslte:

Sandcastle code ( http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html )

// code snippet --->
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

function createModel(url, height) {
    height = Cesium.defaultValue(height, 0.0);

    var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, height));

    scene.primitives.removeAll(); // Remove previous model
    var model = scene.primitives.add(Cesium.Model.fromGltf({
        url : url,
        modelMatrix : modelMatrix
    }));

    model.readyToRender.addEventListener(function(model) {
        // Play and loop all animations at half-spead
        model.activeAnimations.addAll({
            speedup : 0.5,
            loop : Cesium.ModelAnimationLoop.REPEAT
        });

        // Zoom to model
        var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
        var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
        var camera = scene.camera;
        camera.transform = transform;
        var controller = scene.screenSpaceCameraController;
        var r = 5.0 * Math.max(model.boundingSphere.radius, camera.frustum.near);
        controller.minimumZoomDistance = r * 0.5;
        camera.lookAt(new Cesium.Cartesian3(r, r, r), Cesium.Cartesian3.ZERO, Cesium.Cartesian3.UNIT_Z);
    });
}

///////////////////////////////////////////////////////////////////////////

createModel(‘https://dl.dropboxusercontent.com/u/3050123/test.gltf’, 0);

// <---- code snippet

Quarta-feira, 17 de Setembro de 2014 11:09:40 UTC+1, Vladimir Elistratov escreveu:

Hi Andre!

Thank you for the reply!

Certainly I missed an obvious think.

I tried northEastDownToFixedFrame and northEastUpToFixedFrame. The latter function doesn’t exist.

The correct function is eastNorthUpToFixedFrame

Best regards,

Vladimir Elistratov