Bug in X File Loader ?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
s0rcer0r
Posts: 11
Joined: Wed Nov 03, 2004 10:48 pm
Location: Bucharest

Bug in X File Loader ?

Post by s0rcer0r »

Hi all

I was loading an .X model file with Irrlicht (a cylinder) and I had some strange rendering problems.
After playing a little bit I discovered that the problem is that in the vertex array list I had a space between the coordinates of the vertex
(e.g. 0.000000; 1.000000 ; 2.000000;,)
The problem appeared only when I was loading the file in Irrlicht...the DirectX MeshViewer loads the file ok.
Is there supposed to be no space/whitespace between the coordinates or there is a problem with the parsewhitespaces function that the X loader is using ?

Here are some links to pics showing the effect in Irrlicht:

Model with space between coordinates:
http://193.231.143.252/~lord_avi/irrlic ... _space.JPG
Model with no space between coordinates:
http://193.231.143.252/~lord_avi/irrlicht/no_space.JPG

And here are the .X models:

Model with space between coordinates:
http://193.231.143.252/~lord_avi/irrlic ... th_space.x
Model with no space between coordinates:
http://193.231.143.252/~lord_avi/irrlic ... no_space.x
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

The problem is that Irrlicht is very picky about how it gets its .x files. Every package exports sligthly differently, and Irrlicht has trouble with certain syntax. The DX Meshviewer will load almost every .x file, which is a good thing. If you have a .x which will not display properly in irrlicht, load it with DX Meshviewer and resave. Irrlicht is generally fine with files saved from DX Meshviewer.

I don't know the exact .x format specification about whether whitespace is allowed or not. I suspect (without looking at irrlicht .x loading code) that the engine just assumes there will be vertex coordinates on every line until it encounters a closing brace. I wouldn't exactly call it a bug.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

he problem is that Irrlicht is very picky about how it gets its .x files. Every package exports sligthly differently, and Irrlicht has trouble with certain syntax. The DX Meshviewer will load almost every .x file, which is a good thing. If you have a .x which will not display properly in irrlicht, load it with DX Meshviewer and resave. Irrlicht is generally fine with files saved from DX Meshviewer.

I don't know the exact .x format specification about whether whitespace is allowed or not. I suspect (without looking at irrlicht .x loading code) that the engine just assumes there will be vertex coordinates on every line until it encounters a closing brace. I wouldn't exactly call it a bug.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
s0rcer0r
Posts: 11
Joined: Wed Nov 03, 2004 10:48 pm
Location: Bucharest

Post by s0rcer0r »

From what I remembered from the XFileLoader code I thought there was a function called findNextNoneWhiteSpaceNumber that would skip over the whitespaces...in fact I can put white spaces between two different vertices in the Vertex Array List with no problem... that's why I thought this was a bug (not skiping the whitespaces between the coordinates of a single vertex)!
As for my models I can't use the DXMeshviewer to save them because I'm generating them directly from my program...int the end I solved the problem by removing the space and now it loads correctly.
Anyway thanks for the suggestion !
Post Reply