SciChart Android 3D Charts API > 3D Chart Types > The Free Surface 3D Chart Type > The Ellipsoid 3D Chart Type
The Ellipsoid 3D Chart Type

Ellipsoid 3D Charts are provided by the EllipsoidDataSeries3D type.

 

The location of the EllipsoidDataSeries3D is defined by following properties:

  • OffsetX – a location of the Ellipsoid by the X-Axis
  • OffsetY – a location of the Ellipsoid by the Y-Axis
  • OffsetZ – a location of the Ellipsoid by the Z-Axis

The size of the EllipsoidDataSeries3D is defined by following properties:

    A – a radius of the Ellipsoid along the X-Axis
    B – a radius of the Ellipsoid along the Y-Axis
    C – a radius of the Ellipsoid along the Z-Axis

Ellipse 3D
Copy Code
final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
surface3d.getWorldDimensions().assign(200, 200, 200);
final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
final int sizeU = 40, sizeV = 20;
final EllipsoidDataSeries3D<Double> meshDataSeries = new EllipsoidDataSeries3D<>(Double.class, sizeU, sizeV);
meshDataSeries.setA(6d);
meshDataSeries.setB(6d);
meshDataSeries.setC(6d);
final Random random = new Random();
for (int u = 0; u < sizeU; u++) {
    for (int v = 0; v < sizeV; v++) {
        final double weight = 1d - Math.abs(2d * v / sizeV - 1d);
        final double offset = random.nextDouble();
        meshDataSeries.setDisplacement(u, v, offset * weight);
    }
}
final int[] colors = {0xFF1D2C6B, Blue, Cyan, GreenYellow, Yellow, Red, DarkRed};
final float[] stops = {0, .1f, .3f, .5f, .7f, .9f, 1};
final FreeSurfaceRenderableSeries3D rs = sciChart3DBuilder.newFreeSurfaceSeries3D()
        .withDataSeries(meshDataSeries)
        .withDrawMeshAs(DrawMeshAs.SolidWireframe)
        .withStroke(0x77228B22)
        .withContourInterval(0.1f)
        .withContourStroke(0x77228B22)
        .withStrokeThicknes(1f)
        .withLightingFactor(0.8f)
        .withMeshColorPalette(new GradientColorPalette(colors, stops))
        .build();
UpdateSuspender.using(surface3d, new Runnable() {
    @Override
    public void run() {
        surface3d.setCamera(camera);
        surface3d.setXAxis(xAxis);
        surface3d.setYAxis(yAxis);
        surface3d.setZAxis(zAxis);
        surface3d.getRenderableSeries().add(rs);
        surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
    }
});