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

Cylindroid 3D Charts are provided by the CylindroidDataSeries3D type.

 

The location of the CylindroidDataSeries3D is defined by following properties:

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

The size of the CylindroidDataSeries3D is defined by following properties:

  • A - a distance from the origin to the internal edge of the cylindroid 3D Surface
  • B – a distance from the origin to the internal edge of the cylindroid 3D Surface
  • H – a height of the Cylindroid along the Z-Axis
    Cylindroid 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 CylindroidDataSeries3D<Double, Double> meshDataSeries = new CylindroidDataSeries3D<>(Double.class, Double.class, sizeU, sizeV);
    meshDataSeries.setA(3d);
    meshDataSeries.setB(3d);
    meshDataSeries.setH(7d);
    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());
        }
    });