Thank you for your help.
Take a look at our 3D models demo: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html&label=Showcases
We are using the function Transforms.headingPitchRollQuaternion to get the orientation for the model.
Hope this helps!
-Hannah
Hi Hannah,
Thank you for replying. I looked at the 3D models demo from the link you suggested and they are standing still. Is there a different example to see the 3D model is moving using lat, long, alt, pitch and roll.
Thank you.
var viewer = new Cesium.Viewer('cesiumContainer', { infoBox : false, selectionIndicator : false});
viewer.scene.camera.setView({ position: new Cesium.Cartesian3(-2654967.1393059366, -4137274.088087724, 4400287.295814132), heading: 0.005279793055563253, pitch: -0.818713136947244, roll: 0.000025898904649324095});
var lon = -123.0744619;var lat = 44.0503706;var position = Cesium.Cartesian3.fromDegrees(lon, lat, 5000.0);var heading = Cesium.Math.toRadians(135);var pitch = 0;var roll = 0;var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, pitch, roll);
var url = '../../SampleData/models/CesiumAir/Cesium_Air.bgltf';var entity = viewer.entities.add({ name : url, position : position, orientation : orientation, model : { uri : url, minimumPixelSize : 128 }});
var sign = 1;var count = 0;var i = setInterval(function(){ var diff = Cesium.Math.toRadians(1)*sign; heading += diff; pitch -= diff; lon -= diff; lat += diff; position = Cesium.Cartesian3.fromDegrees(lon, lat, 5000.0); count++; if (count%50 === 0){ count = 0; sign *= -1; } entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, pitch, roll); entity.position = position;
}, 30);Thank you very much for you help.
Thank you.
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.