Jump to content
  • Advertisement
Sign in to follow this  
jimiwa

need help loading text x files

This topic is 4516 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 wondering how to load x files from models that I create in Blender, Blender only exports text x files. I tried an example loading an x file and displaying it, and the x file was a binary x file, it worked. But when I used the text x files I got from blender, I got an error in loading. If anyone can tell me how to load the text format x files, please tell me. (using VC++ .net 2005 and dx9)

// globals:

IDirect3DDevice9* Device = 0; 
ID3DXMesh*  Mesh = 0;
	

// within a function:

	ID3DXBuffer* adjBuffer  = 0;
	ID3DXBuffer* mtrlBuffer = 0;
	DWORD        numMtrls   = 0;
	hr = D3DXLoadMeshFromX(  
		"file.x",
		D3DXMESH_MANAGED,
		Device,
		&adjBuffer,
		&mtrlBuffer,
		0,
		&numMtrls,
		&Mesh);

	if(FAILED(hr))
	{
		::MessageBox(0, "Mesh Loading Failed", 0, 0);
		return false;
	}

 

Share this post


Link to post
Share on other sites
Advertisement
If you think the file format is the problem, try using DXOps to convert from text to binary format.

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!