C# programmer, beginner DirectX. Have created 2 meshes using Mesh.Cylinder but need to combine them into a single mesh. Is that possible?
+1
A:
Yeah thats doable. You have a transform matrix for both meshes presumably?
Lock both meshes and then take the 1st mesh (I will assume we add it to the second) and transform its vertices one by one by the matrix transformation transfoming from cylinder 1s local space to clyinder 2's local space (ie [cylinder 1 world transform] * [inverse cylinder 2 world transform]). Define up the correct indices and you have now added mesh 1 to Mesh 2.
It will get more compilcated if you want both meshes to intersect properly. If you want to do that I suggest you look into Constructive Solid Geometry (CSG). There are plenty of links to be found on google on the subject.
Goz
2010-03-26 14:50:50