Sign in to follow this  

Q: DX9, Mesh A + Mesh B = Mesh C

This topic is 4484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

-------------English/Englisch---------------------- How is it possible to combine two meshes to a single mesh? The reason is that I have to show hundreds of small meshes and the performance of rendering one big mesh with identical number of vertices is quite better. (I've tried it out using vertex buffers to make a mesh) Now I want to take two meshes A and B, which were created with a 3D software and loaded as *.x-file by the directx loadmesh function, and put them together to a third mesh C. (Mesh A + Mesh B = Mesh C, if possible including previous transformation, materials and texture .) If anyone has any suggestions or ideas to manage this, or if there is a tutorial, sourcecode etc. please help :-) Thanks, Holger ------------------German/Deutsch------------------------- Wie kann man es schaffen, zwei Meshes zu einer zusammen zu fassen? Ich habe herausgefunden, das es enorm Laufzeiteffektiver ist eine große Mesh zu verwenden, statt mehrere hundert von kleinen, trotz gleicher Anzahl von Vertices. Das habe ich per Vertex-Buffer ge- testet, doch damit kann man nur begrenzt schöne Meshes bauen. Jetzt will ich zwei Meshes (A, B) mit der DirectX LoadMesh Funktion als *.x Datei laden, transormieren und anschließend zu einer Mesh C zusammenfassen ohne die Materialien oder Texturen zu verlieren. Hat das schon mal jemand gemacht oder gesehen wie's geht oder eine Idee oder Tutorial oder ein Stück Quellcode oder sonstwas? :-) Vielen Dank im Voraus, Holger

Share this post


Link to post
Share on other sites
Hi there Dixnet,
How are you doing?

The Problem
Combining 2 meshes to form a single mesh

The Solution
If you have 2 meshes of let's say 200 primitives each. And you combine them keeping them the same mesh will result in a mesh of 400 primitives. Although the state changes and number of draw calls are going to be a costly event. I am sure that it won't affect it that much, what you might want to do is what you mentioned.


What you can optionally do is use the D3DXConcatenateMeshes function that combines an array of meshes but you can apply different transformation matrices to each mesh.

I hope this helps buddy. Take care.

Share this post


Link to post
Share on other sites
Hi Armadon,

Thank you for your very quick answer.

I think, the "D3DXConcatenateMeshes" function will do the job. Great!

The reason why I haven't found it by myself is, that I develope in VB.Net and not in C#, so I do not know the D3DX - C# libraries.

My next step will be, to make the C# function fit into VB.Net :-) Should be possible, some way...

Thanx a lot!

Holger

Share this post


Link to post
Share on other sites
In managed DirectX, the equivalent function is a static method of the PrtEngine class, ConcatenateMeshes. While it is useful in PRT techniques, it isn't strictly a PRT-related function regardless of it's placement in the library.

Share this post


Link to post
Share on other sites

This topic is 4484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this