开发者

3d object visible in WPF

I'm playing around 3d objects in WPF. I have a viewport3d. This contains two 3d object (ModelVisual3d) named "A" and "B".

I want to just sh开发者_StackOverflowow A and hide B,

sometimes, I want to just show B and hide A.

How can I do hide it?

I'm found answer, but this tell "set the OffsetX property to 1000.". I don't like it.

Is it possible to hide object?


Are you working only with xaml? You could just remove the ModelVisual3D object from the viewport and add them when you need want them visible. Like:

Visual3D A = ...
Visual3D B = ...
// invisible A, visible B
viewport3d.children.remove(A)
viewport3d.children.add(B)
// visible A, invisible B
viewport3d.children.add(A)
viewport3d.children.remove(B)

Just make sure you keep the A (and B) reference somehow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜