Question about CZML primitives (sphere or ellipsoid)

I’m looking into cesium for a project I’m working on, and I’m curious how difficult it would be to add support for sphere elements to CZML and rendering support to cesium? I’m been poking around in the code and documentation and this doesn’t seem to be supported at present (please correct me if I’m wrong). The CZML processing part seems pretty straightforward, but its not clear to me what would be involved in adding the rendering support.

I hope this question isn’t out of bound for this group. Thanks for any help.

Thanks

Hi James,

This would be a welcomed contribution. We would probably add support for ellipsoids, and get spheres as a side effect.

The rendering side is not too hard. We would render them with GPU ray casting for visual quality. We’d render a bounding box around the ellipsoid with front-face culling, and then cast rays in the fragment shader to see if the ellipsoid is hit or not. If so, we’d compute the normal and texture coordinates, and pass it along to the material and lighting system. We’d need to be careful for when the viewer is inside the ellipsoid - no problem though.

At the bottom of the tree in the Sandbox, there is an example for rendering a box, and we have code in the CentralBody to cast a ray through a fragment. So this is just a matter of pulling the code together, implementing picking (easy), writing tests, etc.

I’d like to code it myself, but I will not be able to get to it soon. However, I can provide guidance if you are interested.

Regards,

Patrick

Hi James,

Did you implement this? If not, Kristian is interested in doing it. I just want to make sure we’re not duplicating any effort.

Regards,

Patrick