使用DirectX以VC ++形式包含3D网格 [英] Include 3D mesh in VC++ forms using DirectX

查看:100
本文介绍了使用DirectX以VC ++形式包含3D网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在vc ++ windows窗体中加载mesh(.x)文件并显示在窗体窗口中.谁能指导我如何在vc ++ Windows窗体中加载和显示(.X)文件?

谢谢,
Venky

I need to load a mesh(.x) file in vc++windows forms and display in the form window. Can any one guide me how to load and display (.X) files in vc++ windows forms

Thanks,
Venky

推荐答案



解决方案很简单,实现起来有点复杂^ _ ^ ...

1-在Dx Sdk上使用示例项目来加载网格或动画网格(最大的熊猫导出不是完美的,但是可以使用正确的参数进行操作.)
2-转换示例以使其呈现在没有FSAA的纹理上,例如紫色背景.
3-访问纹理以在其上获得DC(在我看来,您可以使用Surface
完成此操作 * IDirect3DTexture9-> GetSurfaceLevel = IDirect3DSurface9.
* IDirect3DSurface9-> GetDC = HDC
4-使用分层的(颜色键)窗口属性在表单上加亮.

我在2004年这样做是为了完成其工作,但是网格的边界很清晰.

您可以使用FSAA并访问渲染目标的Z-buf来提取信息以重新构建边框抗锯齿并手动将其blit到Windows DC,但是CPU成本更高.

对于Win7之类的新闻操作系统,请尝试在DXGI上查找,它可能包含其他更友好使用的解决方案.

我一天结束时要放假7天,所以不要问我更多关于复制的知识,在此期间,我会关闭大脑和计算机...

再见...

加载动画网格物体:http://www.toymaker.info/Games/html/load_x_hierarchy.html
渲染到纹理:http://www.two-kings.de/tutorials/dxgraphics/dxgraphics16.html
Layared窗口:http://msdn.microsoft.com/en-us/library/ms997507.aspx
Hi,

Solution is easy, implementation a little bit more complicated ^_^...

1 - Use sample project on Dx Sdk to load a mesh or an animated mesh (Panda export for max is not perfect but it work...with the right parameters).
2 - Transform the sample to render it on a texture without FSAA, with for example a purple background.
3 - Access the texture to get a DC on it (to my mind you can do this using Surface
* IDirect3DTexture9 -> GetSurfaceLevel = IDirect3DSurface9.
* IDirect3DSurface9 -> GetDC = HDC
4 - Blit on forms using layered (color key) windows properties.

I do this on 2004 for a job its works but the border of the mesh is sharp.

You may use FSAA and access Z-buf of the render target to extract information to re-build border antialiasing and blit manually to Windows DC, but CPU cost with be higher.

For news OS like Win7, try looking on DXGI it may contain an other solution more friendly use.

I''m in holidays at the end of the day for 7 days, so don''t ask me more explication about explication, I switch off my brain and my computer during this period...

Have fun Bye...

Load Anim Mesh : http://www.toymaker.info/Games/html/load_x_hierarchy.html
Render to Texture : http://www.two-kings.de/tutorials/dxgraphics/dxgraphics16.html
Layared Window : http://msdn.microsoft.com/en-us/library/ms997507.aspx


这篇关于使用DirectX以VC ++形式包含3D网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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