Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to get .x file info


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Hawkblood   Members   -  Reputation: 659

Like
0Likes
Like

Posted 12 October 2013 - 03:28 PM

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?



Sponsor:

#2 Hawkblood   Members   -  Reputation: 659

Like
0Likes
Like

Posted 17 October 2013 - 04:14 PM

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-



#3 EddieV223   Members   -  Reputation: 1267

Like
0Likes
Like

Posted 17 October 2013 - 11:29 PM

D3DXFRAME frame;

frame.name;

 

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


Edited by EddieV223, 17 October 2013 - 11:35 PM.

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.1 Download http://www.sfml-dev.org/download.php

SFML2.1 Tutorials http://www.sfml-dev.org/tutorials/2.1/

 

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

 


#4 ankhd   Members   -  Reputation: 933

Like
0Likes
Like

Posted 18 October 2013 - 12:44 AM

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



#5 Hawkblood   Members   -  Reputation: 659

Like
0Likes
Like

Posted 21 October 2013 - 01:23 PM

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



#6 wintertime   Members   -  Reputation: 1537

Like
0Likes
Like

Posted 21 October 2013 - 01:45 PM

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



#7 Hawkblood   Members   -  Reputation: 659

Like
0Likes
Like

Posted 25 October 2013 - 08:50 PM

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

 

How should I handle CR/LF?



#8 Dragonsoulj   Crossbones+   -  Reputation: 1998

Like
0Likes
Like

Posted 25 October 2013 - 10:01 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS