开发者

XNA, subtract 2 meshes at runtime?

i wanted to know how to edit 3d models' vertices in XNA at runtime, i开发者_如何学运维 wana do something like the 3d max subtract feature where u put 2 models together and delete the intersecting vertices of 1 of them, more like carving one mesh with the other.

see this if i wasn't clear

anyway so any pointers on how to edit vertices at runtime or any help is really really appreciated.

thanks


You can't do that.

AFAIK, OpenGL, DirectX and XNA have no utility functions for boolean operations on triangulated meshes (if they had those, we would be seeing fully destructible environments in every game on the market). If you want to do that, you'll have to implement boolean operations yourself. It will be EXTREMELY difficult (especially dealing with topology), and I mean it (tried to do that, will implement them someday (as exercise) when I have more time).

Or you could try adapting/using source code from blender or libgts. BOth of them have implemented boolean operations, but they are written in C/C++, not in C#, so it will be "fun" no matter how you look at it. Also, be careful about licenses if you decide to use their code. Both use flavors of GPL, and GPL is "viral" license.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜