3

I am trying to display the 3D model depicted below using HelixToolkit. (The following snapshot's taken from SolidWorks.)

enter image description here

I set the brush color of the DiffuseMaterial used as Material and BackMaterial of my GeometryModel3D to a tranparent color.

Model3DGroup faceVisualEntity = ModelFaces.First(modelFace => modelFace.Content.GetName() == faceName).Content as Model3DGroup;

// Breaking the 3D-model down to the constituting mesh..
//
foreach (var child in faceVisualEntity.Children)
{
    if (child is GeometryModel3D)
    {
        GeometryModel3D body = child as GeometryModel3D;
        body.Material = new DiffuseMaterial(new SolidColorBrush("#40FF0000"));
        body.BackMaterial = new DiffuseMaterial(new SolidColorBrush("#40FF0000"));
    }
}

However, what I can see in HelixViewport3D is like below.

enter image description here

While the sides of the box seem to be transparent, I wonder why the pipes inside the box cannot be seen. I also changed the color of the pipe walls to an opaque value, but cannot see them yet.

enter image description here

Mehdi
  • 2,194
  • 2
  • 25
  • 39

1 Answers1

3

The fact is that using the transparency feature of the HelixToolkit is not achieved by changing the alpha channel of the model faces material only. Actually, there is an example in the HelixToolkit code showing that a SortingVisual3D is required to support transparency for the model. So, I first added an instance of SortingVisual3D to the HelixViewport3D and then added the Visual3D objects, such as ModelVisual3D, LinesVisual3D, etc., to it. As a result, what I can see now is like below.

enter image description here enter image description here

Mehdi
  • 2,194
  • 2
  • 25
  • 39