Hi, I’m using camera.lookatTransform method to adjust my camera to achieve pilot view. My code is like this:
{
text:‘track plane from pilot view’,
onselect:function(){
viewer.clock.onTick.addEventListener(function(clock){
var referencePoint=positions.getValue(clock.currentTime);
var transform=Cesium.Matrix4.fromTranslationQuaternionRotationScale(
plane05.position.getValue(clock.currentTime),
plane05.orientation.getValue(clock.currentTime),
new Cesium.Cartesian3(1,1,1),
new Cesium.Matrix4()
);
// always look at the plane from behind
viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(-100.0,0.0,100.0));
});
}
}
Whenever I run this code, it stops rendering and alerts ‘Normal must be normalized.’ Can anybody kindly tell me what’s wrong with my code? Or is there a better way to adjust the camera so that I can track the plane and keep looking from behind it?