Hello, I am using lootAtTransform with this code for chasing entity:
var matrix3Scratch = new Cesium.Matrix3();
var positionScratch = new Cesium.Cartesian3();
var orientationScratch = new Cesium.Quaternion();
function getModelMatrix(entity, time, result) {
var position = Cesium.Property.getValueOrUndefined(entity.position, time, positionScratch);
if (!Cesium.defined(position)) {
return undefined;
}
var orientation = Cesium.Property.getValueOrUndefined(entity.orientation, time, orientationScratch);
if (!Cesium.defined(orientation)) {
result = Cesium.Transforms.eastNorthUpToFixedFrame(position, undefined, result);
} else {
result = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation, matrix3Scratch), position, result);
}
return result;
}
viewer.scene.preRender.addEventListener(function(){
getModelMatrix(currentPositionEntity, viewer.clock.currentTime, scratch);
viewer.scene.camera.lookAtTransform(scratch, new Cesium.Cartesian3(0.0, 300.0, 700));
});
There is Sandcastle example
Is there a way to move tracked entity from center to bottom of the screen (same as Google Map app in navigation mode)?