Question 1:

In Cesium.Shapes there is a static function named "computeEllipseBoundary". One of the params it takes is "rotation". I understand what this value is, but I'm not sure how to get it without hard-coding.

I want the rotation value to change depending on where my mouse is at a given time. For example, if my mouse is at a 45 degree angle on the 3D globe, I want to know that. I'm trying to constantly re-draw an ellipse until I release the left click on the mouse, so I need my params to constantly update until I'm finished drawing the ellipse.

Question 2:

In Cesium.Cartesian3 there is a static function named "angleBetween". The documentation says it returns "the angle between the Cartesians". What does that mean? What angle? I was hoping it would return a value I could use as the "rotation" in my first question, but it doesn't look like that is what it's trying to do.

Any help on either question is much appreciated!

In Cesium an ellipse is drawn along a line of longitude that passes through the center point.
Noting that positive x points East and positive y points North you can do something like this which is a modification of the Ellipse example in SandCastle.

``````// Green ellipse with height
// Default orientation of ellipse is along north/south
// Remember that positive x is East and positive y is North
var north = Cesium.Cartesian3.fromArray([0.0, 1.0, 0.0]);
var mouse = Cesium.Cartesian3.fromArray([1.0, 1.0, 0.0]);
var rotationAngle = Cesium.Cartesian3.angleBetween(north, mouse);

ellipseGeometry = new Cesium.EllipseGeometry({
center : ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-95.0, 35.0)),
semiMinorAxis : 200000.0,
semiMajorAxis : 400000.0,
rotation : rotationAngle,
height: 200000.0,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
});``````