none
WPF 3D中多个模型如何设置某一个在最前? RRS feed

  • 问题

  • 问题:我们的模型包括导入的3D solid模型和axis坐标轴模型,当模型旋转的时候,3D会将axis挡住。

    期望:axis一直在最前面,不会被3D挡住。

    求解决方法,谢谢!
    2009年3月26日 2:06

答案


  • Hello,

    It seems that you wants to see through a 3D object (for example, a cube), to see the object behind it. If this is the case, the only solution is to make the cube semi-transparent or fully transparent. This is similar to the real world. If a table is behind the wall of a house, you won't be able to see it. But if it is behind a window, you can still see it.

     

    One thing to note is how WPF 3D handles transparency. In the above sample, if the windows comes before the table in the visual tree, you still won't be able to see through it. You have to put the non-transparent elements before the transparent ones. There is a helper class which can help you to solve this problem. Have a look at http://blogs.msdn.com/pantal/archive/2007/07/23/sorting-for-wpf-3d-transparency.aspx .


    Microsoft Online Community Support
    2009年3月31日 2:46