Home » Community » Forums » » How to parse .X files
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 How to parse .X files
Post Reply 
this is one of the crapiest articles I've ever read... thanx for wasting my time. I use the term "article" very loosely since it usually means the paper has content.

 User Rating: 1015    Report this Post to a Moderator | Link

Whatever dude, you just don't know what you're doing. Haha.
Actually, this article very nicely fills the gap between
the documentation just leaves you hanging, with no guidance
whatsoever.

 User Rating: 1015    Report this Post to a Moderator | Link

Actually, I found this article super helpful, after beating my head against the horrible documentation for too long. Thanks Jim!

One correction, though. In ParseXFileData(), pName is allocated as "new char[9]", but deleted without the array version of delete. Just change the last line from

delete pName;

to

delete [] pName;


 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

This article is helpful in that it explains how to get skinning and animation information from x-files. Without that, there can be no animation in your 3D engine! However, there are a few problems. The code does not compile on DX 8.x systems because the retained mode GUID's have been left out. And of course, it won't work on DX 7 and lower systems. So basically, if you want to compile this code, you need to put in the correct libraries manually and link them. This is an enormous pain in the butt.

However, this is mostly Microsoft's fault, not the author's.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Hey, Im looking for a lightwave or 3D studio Max to .X file converter, anyone know where I could find one???

.lwo version 6 / 7
.3DS 3 & >

thanks

 User Rating: 1015    Report this Post to a Moderator | Link

You can get the 3d max and maya exporters to .x files from the directx 8 SDK in the microsoft downloads area.

 User Rating: 1015    Report this Post to a Moderator | Link

this file is conv3ds.exe.

 User Rating: 1015    Report this Post to a Moderator | Link

There is a plug-in, to export to x-file format, for 3ds max here: http://www.pandasoft.demon.co.uk/directxmax4.htm




 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I'm having trouble extracting STRING data types from .x file types. Here's a message I posted on the DX forums.


Hello,
I am using the DX API to parse .x text files and things are going well, but I have run into one problem. I am having trouble extracting STRING types from the text file data. I am using GetData() from the IDirectXFileData interface, walking that buffer and extracting the data. Every STRING data type seems to always be 3 bytes + 1 NULL terminating. I have searched the sample code and the web a bit, looked over some fourms, but I can't seem to find anything. The documentation doesn't mention anything about the STRING data type being any type of handle or reference, compressed string or anything. It simple states: "STRING - NULL terminated string".

Has anyone delt with this? Anyone have any pointers? Anyone want to smack MS?

-robert

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Thanks to JimAdams! I had found the way of parsing .x files.Before reading this article,iam unable to properly
organize the scanning of templates(embedded).After reading this
article i simply used the CList MFC Class to give life to my
3D character.

balau

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I'm working through the tutorial and it won't build.

With dxfile.h included and d3dx8of.lib in my additional dependencies where I already have dxguid.lib I get:

'D3DRM_XTEMPLATE_BYTES' : undeclared identifier
'D3DRM_XTEMPLATES' : undeclared identifier


If I change d3dx8of.lib to d3dxof.lib I get the same. If I also include rmxfguid.h I still get the same. If I include rmxftmpl.h I get:

LNK2005: "unsigned char * D3DRM_XTEMPLATES" (?D3DRM_XTEMPLATES@@3PAEA) already defined


I also tried adding odbc32.lib and odbccp32.lib that the demo had with no change.

The other includes my project already had are windows.h, ddraw.h, D3d8.h D3dx8mesh.h, stdio.h, iostream and fstream. The other library files are ddraw.lib, D3d8.lib and D3dx8.lib.

How do I get around this?



 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

* bump *

Im now in the previous posters spot... wont compile.. i get

'D3DRM_XTEMPLATES' : undeclared identifier :(

anyone sucessfully enumerate an x file with dx9?

thx,
-sd

 User Rating: 1045   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

just make sure the files:

#include "rmxftmpl.h"
#include "rmxfguid.h"

are included (in the .CPP not the header)

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Hi, I am trying to use this code but I am not sure how I can obtain the data from the xfile. Say I want the data of the Mesh template, how should I do that?

// Get the template data
if(FAILED(pData->GetData(NULL, &dwSize, (PVOID*)&pBuffer)))
return;
// Do whatever with data. Note that you can cast
// the pointer to anything. Be sure to copy data
// out of buffer before proceeding.

I try to print out pBuffer but it gives me weird stuff. Is it possible for the code to read in the data line by line after it has found the template?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I know that X-files are considered Legacy files by Microsoft since DirectX 9.0c, so I was wondering whether it would be helpful or not to convert the parsing routine to DirectX 9.O.

Any ideas? or should I just junk the whole parse routine?

- Sturm


 User Rating: 1015    Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: