Sign in to follow this  
JoeyBlow2

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

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
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

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