1. A concise explanation of the problem you're experiencing.
I was wondering what the best way to put a billboard on the outline of an ellipse graphic would be.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
My issue is trying to determine the position to place it in. Right now I have:
position: new Cesium.Cartesian3(entity.position._value.x + entity.ellipse.semiMinorAxis, entity.position._value.y, entity.position._value.z)
but that doesn't work. I'm not quite sure how to approach this.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to use the billboard to adjust the radius of the ellipse.
4. The Cesium version you're using, your operating system and browser.
Cesium 1.47, Centos, Firefox
Your code would work if you were using a flat model of the earth. You’ll need to take into account the curvature, depending on how big your ellipse is.
I think this would be easier to do in Cartographic coordinates. The answer here describes a quick way to convert the offset in meters (the radius) to long/lat: https://gis.stackexchange.com/a/2980
So it could look something like this:
// Get circle position in lat/long
var position = Cesium.Cartographic.fromCartesian(circle.position.getValue(time));
var radius = circle.ellipse.semiMajorAxis.getValue(time);
// Set the billboard height above the circle
position.height = circle.ellipse.height + 30000;
// Convert radius offset to longitude as described in https://gis.stackexchange.com/a/2980
position.longitude += (radius / (111111 * Math.cos(position.latitude) * (180/Math.PI)));
// Convert back to Cartesian3
Here’s a working example to illustrate this. Let me know if this helped!
Thank you so much! This helped a lot. It's a tiny bit off, but I think I can fix that.