How to get .x file info

Started by
6 comments, last by Dragonsoulj 10 years, 5 months ago

I have an x file with several subsets in the mesh object. I would like to reference each subset by its name, but I can't find a reliable way to do that. I thought when I loaded it, there would be some kind of information saved that would include the string name.... Maybe I'm smok'n something.

Does anyone know what I mean and how to do it?

Advertisement

Seriously? No one can point me in the right direction? I know it can be done, I just don't know a good way to do it.......

-BUMP-

D3DXFRAME frame;

frame.name;

If you don't mean frames then subsets are usually ID'ed by a DWORD.

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

Hello.

Its the frame name in the .x file its like this here.

Frame Wheel05 {

FrameTransformMatrix {

-0.000001,0.000000,-2.116935,0.000000,-2.116935,0.000000,0.000000,0.000000,0.000000,2.116935,0.000000,0.000000,7.810452,-18.614912,387.071350,1.000000;;

}

Mesh {//here is your mesh for this frame name

4416;//number of vertices .

28.135689;0.000000;0.000000;,

26.438898;18.357489;9.622972;,

26.438898;0.000000;9.622972;,

26.438898;18.357489;9.622972;,

28.135689;0.000000;0.000000;,

28.135689;18.357489;0.000000;,

Is there no way to get that without going through the file as text?

I have tried to read the file like a text file, but I keep getting EOF before the end; resulting in an incomplete list.....

If its stopping on Ctrl-Z you should read the file in binary mode and handle CR/LF yourself.

I'm using std::ifstream with "ifstream::in||ifstream::binary"

How should I handle CR/LF?

If the number is 10 or 13, you are at the end and start of a new line. I believe the order is 13 then 10 for Windows, 13 for Linux, and 10 for Mac*, depending on if it is using an actual newline (read: Enter style keypress) or if the program is just writing out a newline (which could vary).

* I may have Linux and Mac flipped.

This topic is closed to new replies.

Advertisement