.X File Loading

Started by
0 comments, last by Schrompf 15 years, 6 months ago
I'm trying to load a file using the sample 3 code provided here http://www.gamedev.net/reference/programming/features/xfilepc/ I can get the file that is provided with this code to load and display properly but anytime I try to use any other .x files that I've exported from blender the program crashes immediately and I can't seem to figure out why. I get the error "Debug Assertion failed"..."Expression: list iterator not dereferencable". I would appreciate any help.
Advertisement
The blender xfile exporter occassionally puts invalid floating point values into the files. Look out for strings like "-1.#IND00" oder "1.#QNAN0" and handle them as a special case. Your average floating point parser will propably choke on these. But I can't tell if this is the actual reason for the error you encountered. You'll have to use the debugger and see for yourself. Alternatively you might want to take a look at Assimp, a flexible importer library which reads .x files and others. I wrote the xfile loader for this library, and I, too, had to add special parsing for invalid number string for the blender exporter. You might save yourself some work by using this library.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

This topic is closed to new replies.

Advertisement