Jump to content
  • Advertisement
Sign in to follow this  
JoeyBlow2

Is there anyway to convert Vertex/Index buffer into a mesh and save it as .x?

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

I'm trying to take a vertex/index buffer and save it as a .x file. Is there any easy way to do that? I am not using FVF and am using Vertex Declarations that are explained in the DX9 SDK. When I looked at the docs I seen no way to do it easily but I might have missed something. Or if someone has done it before, maybe they don't mind sharing? Thanks for any help. I'd rather not calculate the 67000 polygons from scratch every time. I'd rather just save it without calculating the normals, etc every time.

Share this post


Link to post
Share on other sites
Advertisement
Hi, yes just create a ID3DXMesh (using D3DXCreateMesh or D3DXCreateMeshFVF) and fill it with your data (lock and write) and then call D3DXSaveMeshToX.

Share this post


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

The Problem
Saving mesh/vertex buffer information to a .x file.
The Solution
Once again DirectX comes to the rescue with a interface called ID3DXFile.

So what you need to do is read on how to create the ID3DXFile::CreateSaveObject() which will help you to save information to a .x file :)

I hope this helps buddy.
Take care and if you have any more questions do not hestitate to ask.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!