PipeVisual3D is transparency issue

Anonymous 9 years ago updated by anonymous 3 years ago 0
This discussion was imported from CodePlex

Mrme wrote at 2013-11-04 14:26:

I added some models first and then added a PipeVisual3D , when I make the PipeVisual3D transparent by changing the Material and BackMaterial opacity, those models I added first appear just fine inside the pipe when I look from outside side, but if I added some models after I already add the PipeVisual3D, none of these appear , it looks transparent but it actually it is not , I would appreciate any clue

RobPerkins wrote at 2013-11-05 17:34:

You must manually control the order of the Visual3D elements which you add to the scene, since WPF doesn't do transparency in the same way as OpenGL or even DirectX.

Add your Visual3Ds in order of decreasing opacity to get the right effects.


Mrme wrote at 2013-11-05 18:43:

Thanks for your reply, Opacity is just for the PipeVisual3D, so the models are always with Opacity = 1, I don't have the choice here, the users want to be able to add some models/PipeVisual3D and delete them at any time, as I understood from your post , I have always to make sure that the models have to be as if they were added first, when I add a new model and change it's position on the tree,would that solve my problem ?

RobPerkins wrote at 2013-11-06 15:02:

Yes, it's just as you described. WPF renders the elements in list order. Just make sure the elements with less opacity are last in the list.

At times, I do this by specifying one list of Visual3Ds for the opaque stuff, and a second list for the non-opaque, stuff, and lay that out in the XAML. That pretty much guarantees the right behavior.


a5r wrote at 2013-11-06 15:24:

maybe you can use ElementSortingHelper.SortModel(Point3D position, IList<Visual3D> model);