日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

WPF 3D中多個(gè)模型如何設(shè)置某一個(gè)在最前?

 xyjackxjw 2013-05-09

WPF 3D中多個(gè)模型如何設(shè)置某一個(gè)在最前?

分類: WPF 3D488人閱讀評(píng)論(0)收藏舉報(bào)
 

問題:我們的模型包括導(dǎo)入的3D solid模型和axis坐標(biāo)軸模型,當(dāng)模型旋轉(zhuǎn)的時(shí)候,3D會(huì)將axis擋住。

期望:axis一直在最前面,不會(huì)被3D擋住。

方法:

(1) 將模型設(shè)置為透明,<SolidColorBrush Color="#3333CC" Opacity="0.8"/>,同時(shí),將axis使用EmissiveMaterial。

這樣實(shí)現(xiàn)可以在旋轉(zhuǎn)后看到axis,但是這種方法并沒有讓axis放在最前,效果并不好,所以需要繼續(xù)找到其他方法。

(2) 看到有些文章中說到z index,在控件中可以使用它設(shè)置層次,但是在模型中沒有找到類似方法,不知道如何使用。

 

下面是我在微軟論壇上提問獲得的答案:

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./pantal/archive/2007/07/23/sorting-for-wpf-3d-transparency.aspx .

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多