Skip to main content
GameDev.net gamedev.net
🔒 Locked

need help loading text x files

Started by jimiwa Apr 5, 2006 at 8:46 PM 0 replies 700+ views
Original Post
jimiwa
jimiwa
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;
	}

 

Antheus
Antheus
If you think the file format is the problem, try using DXOps to convert from text to binary format.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.