I’m new to Cesium and I’m trying to add a custom 3d object (basically a compass that will stay on the corner of the screen).
I think I got the part of building the actual geometry and rendering it, based on the Cesium primitives code (using Geometry class etc).
My questions are:
1 - Is there a simple way to get a heading angle relative to a Cartographic point (or the North pole, to be more specific). I need this to properly orient the compass geometry.
2 - I need to render the compass with an orthographic projection matrix, to get a pixel perfect orientation, instead of being slightly distorted when put at the corner of the screen. I searched for a way to provide custom matrices for primitives, GeometryInstance does allow to pass a custom model matrix, but not a projection matrix. And this make sense, since Cesium calculates the projection for the globe, etc.
One idea that I had was to use a custom material with a shader that can receive a custom projection matrix as a uniform, instead of using the one passed by Cesium. But I read about Cesium materials and they don’t seem to allow a custom shader.
So I might need to bypass the whole primitive system and draw it separately at the end of the scene rendering, since it is just a widget sitting on top of the world (it is fuly 3D though, so it needs to be draw with Cesium renderer, instead of just overlaying a picture in the webpage)