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

4

1 回答 1

3

事实是,使用 HelixToolkit 的透明度功能并不能仅通过更改模型面材质的 Alpha 通道来实现。实际上,HelixToolkit 代码中有一个示例显示需要 aSortingVisual3D来支持模型的透明度。因此,我首先添加了 的实例,然后SortingVisual3DHelixViewport3D其中添加了 Visual3D 对象,例如ModelVisual3DLinesVisual3D等。结果,我现在可以看到如下所示。

在此处输入图像描述 在此处输入图像描述

于 2016-02-05T00:51:06.057 回答