WPF 3D中多个模型如何设置某一个在最前?
来源:互联网 发布:mac 搜索应用快捷键 编辑:程序博客网 时间:2024/06/11 16:05
问题:我们的模型包括导入的3D solid模型和axis坐标轴模型,当模型旋转的时候,3D会将axis挡住。
期望:axis一直在最前面,不会被3D挡住。
方法:
(1) 将模型设置为透明,<SolidColorBrush Color="#3333CC" Opacity="0.8"/>,同时,将axis使用EmissiveMaterial。
这样实现可以在旋转后看到axis,但是这种方法并没有让axis放在最前,效果并不好,所以需要继续找到其他方法。
(2) 看到有些文章中说到z index,在控件中可以使用它设置层次,但是在模型中没有找到类似方法,不知道如何使用。
下面是我在微软论坛上提问获得的答案:
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 .
- WPF 3D中多个模型如何设置某一个在最前?
- WPF 3D 模型
- 在sparkle中如何对3d模型设置不同的Brush材质
- WPF 3D动态加载模型文件
- VC设置窗口总在最前
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- WPF中如何解决3d模型与贴图不能完全匹配的问题
- 电子政务网络运维实施之道
- keygen是怎么写出来的。
- NHibernate的Session管理
- 工作中的礼仪
- 第一篇,春城雪景(图)
- WPF 3D中多个模型如何设置某一个在最前?
- Servlet API 中文版
- Java语言的Calendar和Date类
- Linux的信号量
- photoshop去眼袋
- linux系统的远程桌面(其实什么系统都合适)
- DSP 6000程序优化(1)
- 被称为“C#圣经”的权威著作!
- 中文与 Unicode 编码的相互转换