Click or drag to resize
AB4D logo

ModelRotatorVisual3DCreateCustomCircleModelCallback Property

Gets or sets a callback delegate that can be used to provide custom 3D model of the circle. See remarks for a sample that shows the code to create the default 3D model.

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
public ModelRotatorVisual3DCreateCustomCircleModel3DDelegate CreateCustomCircleModelCallback { get; set; }

Property Value

ModelRotatorVisual3DCreateCustomCircleModel3DDelegate
Remarks

CreateCustomCircleModelCallback is a callback delegate that can be used to provide custom 3D model of the circle.

Example

The follwing example shows how to create the same circle 3D models that is created by thed default code:

C#
var modelRotator = new ModelRotatorVisual3D();
modelRotator.CreateCustomRotatableCircleModelCallback = delegate(Vector3D normalVector3D, double innerRadius, double outerRadius, Brush circleBrush)
{
    int segmentsCount = 30;
    double circleHeight = outerRadius * 0.05; // Height is 20 times smaller than outer radius

    var tubeMesh3D = new Ab3d.Meshes.TubeMesh3D(new Point3D(0, 0, 0), normalVector3D, outerRadius, innerRadius, circleHeight, segmentsCount);

    var geometryModel3D = new GeometryModel3D(tubeMesh3D.Geometry, new DiffuseMaterial(circleBrush));

    return geometryModel3D;
};
See Also