I have the following problem. I have an app that shows the view from the aircraft nose perspective. I show 3D scene and manipulate the camera with a simple function that uses camera.setView() when the aircraft moves.
function setCamera(lat, lon, height, direction, pitch, roll)
{
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(lon, lat, height ),
orientation: {
heading: Cesium.Math.toRadians(direction), // value is 0.0 (north)
pitch: Cesium.Math.toRadians(-pitch) , // 0 - straight
roll: Cesium.Math.toRadians(-roll) // 0 - horizontal
}
});
It works fine and the aircraft nose always looks at the center of the screen as in the camera1.image
Now, the problem is that I want to hide a bit the view the camera/eye see, so the center of the screen (viewport) IS NOT where the camera/eye look at but is a bit offset. In other words, it would be like when having 2 eyes open I look at the same point and have a 120 fov. then I close left eye and see only 90 fov BUT I still look at the same point seeing 30deg to the left and 60 to the right. I visualised that in the camera2 image. The point at which I want to look is not the center of the screen and I see less to the left (and top as well in that example)
Currently I achieve that effect by rendering the full screen and then clipp the view I show on the web page (camera3 image) with the simple html setting:
@import url(Build.svs/Cesium/Widgets/widgets.css); #cesiumContainer { position: absolute; top: -33%; left: -10.35%; height:133%; width: 110.35%;however the problem is the performance, because cesium will render in memory the full screen and the browser will show only clipped image. The bitmap that is rendered by Cesium is 50% bigger than the one I want to show and I hit performance issue as cesium is embedded into another 3D application that consumes a lot of GPU power.
So the question is how to achieve the same goal without the trick. I am not 3D expert, so I have no clue whether it is frustum related or camera related issue but I believe the goal could be achieved by rendering ONLY the required viewport.
Any help much appreciated
Marcin