Entity on wrong position after downscaling globe

Hi there,

I am pretty new to Cesium and I'm a bit puzzled here... for my atlas of the moon I set the globe to Cesium.Ellipsoid.MOON, but an ellipse on the globe is drawn at the wrong position. If I use the default Cesium.Ellipsoid.WGS84 everything is displayed correctly.

The Cartesian3.fromDegrees() seems to work correctly as its radius matches the radius of the ellipsoid. Any help is welcome!

  var feature = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(lng - 180, lat, 0.0, scene.globe.ellipsoid),
    id: id,
    name: cap,
    description: txt,
    ellipse: {
      semiMinorAxis: max,
      semiMajorAxis: min,
      fill: false,
      outline: true,
      outlineWidth: 1.0,
      outlineColor: Cesium.Color.YELLOW,
      rotation: dir
    }
  });

Hello,

I wasn’t able to reproduce this error. Here is the example I tested with:

var ellipsoid = Cesium.Ellipsoid.MOON;
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
globe: new Cesium.Globe(ellipsoid)
});

var greenCircle = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(-111.0, 40.0, 0.0, ellipsoid),
ellipse : {
semiMinorAxis : 300000.0,
semiMajorAxis : 300000.0,
material : Cesium.Color.GREEN
}
});

``

Let me know if you still can’t get your ellipse to draw correctly. We don’t have great support for non-earth ellipsoids, so I wouldn’t be surprised if you do find other issues.

Best,

Hannah

Thanks for your quick response. The ellipse is still drawn incorrectly, but a label is drawn at the correct position. However, in sandcastle your example works fine...

For now I upscaled the moon to a WGS84 ellipsoid, I will downscale it to a custom ellipsoid at some later stage and try to find the cause then.

So apparently there are three places you need to pass your custom ellipsoid to.
See the discussion in this issue for more information and a workaround that might help avoid other issues: https://github.com/AnalyticalGraphicsInc/cesium/issues/4245

-Hannah