Sign in to follow this  

How to Convert to Trimesh? 3DS MAX

This topic is 4092 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

Hey, I'm new to Max. I wrote an exporter and importer to get models into our game, but right now the importer can only handle trimeshes. I was wondering if there is an easy way in Max to convert a mesh to a trimesh? I'm a little confused because I thought trimeshes were the default. I've zoomed into my model and it looks like it is a mix of quads and tris (though there maybe some n-gons too?) I guess it's not that hard to triangulate n-gons in the importer, but its kind of a pain... Export/Import is always a pain...

Share this post


Link to post
Share on other sites
if i understood correctly u wanted a model thats made out of quads or ngons to be made out of tris? if thats what you want just rightclick on the model and Convert to>Editable Patch

Share this post


Link to post
Share on other sites
You don't need to convert the meshes to "editable meshes" in MAX for that you can export trimeshes. You'll just need to ask the object if you can convert it to Trimesh and then query for the mesh data.



if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0)))
{
tri = (TriObject *) obj->ConvertToType(0,Class_ID(TRIOBJ_CLASS_ID, 0));
// Note that the TriObject should only be deleted if the pointer to it is not equal to the object pointer that called ConvertToType()
if (obj != tri) deleteIt = TRUE;

} else
{
return 1;
}


Mesh pMesh=tri->GetMesh();

etc...





Remember to delete the triobject if (obj != tri), because the triobject is created just because you queried for it.

Cheers

Share this post


Link to post
Share on other sites

This topic is 4092 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