网格渲染问题 [英] Mesh rendering problem

查看:109
本文介绍了网格渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在用C#开发DirectX应用程序,我想绘制一个由大约240个顶点组成的Mesh对象.我使用DirectX 9.0c.虽然,我启用了AutoDepthStencil,并正确清除了ZBuffer,但得到的视觉效果不正确.在前面必须绘制一些必须位于后面的表面.该应用程序例如正确绘制DirectX标准茶壶网格.

Hi,
I am developing a DirectX application in C# and I want to draw a Mesh object which is composed of about 240 vertices. I use DirectX 9.0c. Although, I have enabled AutoDepthStencil, and I clear my ZBuffer properly, I get an incorrect visual result. Some of the surfaces, that must reside behind, are drawn at the the front. The application, for instance draws the directx standard teapot mesh properly. What could be the reason for that problem??

推荐答案

获取Microsoft XNA Game Studio.

使用C#时,请删除DirectX-这将是您自己做过的最好的事情.
Get Microsoft XNA Game Studio.

Drop DirectX when you use C# - it''ll be the best thing you''ll ever done for yourself.


无意义.使用SlimDX.

检查CullMode.我认为您的顶点设置不正确.
Nonsense. Use SlimDX.

Check for CullMode. I think that your vertices isn''t properly setted up.


实际上,剔除模式是CCW.我已经为该剔除模式创建了网格数据和法线.有两个图像显示有问题的渲染的屏幕截图.以下是链接:

对象的前视图:http://img152.imageshack.us/i/frontb0.jpg/

旋转后的视图(显然是假的!):http://img823.imageshack.us/img823/4237/sideut.jpg
Actually, cull mode is CCW. And I ve created mesh data and normals for that cull mode. There are two images which show the screenshots of problematic render. Below are the links:

The front view of the object : http://img152.imageshack.us/i/frontb0.jpg/

The rotated view (which is obviously rendered false!) : http://img823.imageshack.us/img823/4237/sideut.jpg


这篇关于网格渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆