Why is this X file not loaded correctly?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Why is this X file not loaded correctly?

Post by Peter Müller »

Hi!

I tried to load this model but Irrlicht didn't load it. Can you tell me why?

Code: Select all

xof 0302txt 0064 

// Created with AC2X converter (www.stefanzerbst.de) 

Material Standardac2x_1 { 
   0.700000;0.700000;0.700000;1.000000;;   // RGBA Diffus/Ambient 
   50.000000;                              // Specular Power
   1.000000;1.000000;1.000000;;            // RGB Specular 
   0.000000;0.000000;0.000000;;            // RGB Emissive 
   TextureFilename { 
      "modelle/treewood.bmp"; 
      } 
   } // Material 
 
Mesh MainObject { 
   157; // Vertices FORMAT [ x;y;z;, ]
   -1.340835; 0.000000; -0.768291;, 
   -0.342425; 2.844440; -0.475608;, 
   0.425583; 2.844440; -0.402438;, 
   0.271981; 0.000000; -0.987804;, 
   0.271980; 0.000000; -0.987801;, 
   0.425582; 2.844440; -0.402438;, 
   0.502383; 2.844440; 0.256099;, 
   0.809586; 0.000000; 0.256099;, 
   -1.187234; 0.000000; 0.548782;, 
   -0.649628; 2.844440; 0.256099;, 
   -0.342425; 2.844440; -0.475609;, 
   -1.340836; 0.000000; -0.768292;, 
   -0.112022; 0.000000; 0.987807;, 
   -0.112022; 2.844440; 0.621953;, 
   -0.649628; 2.844440; 0.256099;, 
   -1.187234; 0.000000; 0.548782;, 
   -0.112023; 0.000000; 0.987807;, 
   0.809587; 0.000000; 0.256099;, 
   0.502384; 2.844440; 0.256099;, 
   -0.112023; 2.844440; 0.621953;, 
   -0.342425; 2.844440; -0.475609;, 
   -0.496027; 5.831110; -0.914631;, 
   -0.035222; 5.831110; -0.768291;, 
   0.425582; 2.844440; -0.402438;, 
   0.425583; 2.844441; -0.402438;, 
   -0.035222; 5.831111; -0.768290;, 
   -0.035222; 5.831111; -0.329267;, 
   0.502384; 2.844441; 0.256099;, 
   0.502384; 2.844441; 0.256099;, 
   -0.035222; 5.831111; -0.329267;, 
   -0.419226; 5.831111; -0.182925;, 
   -0.112022; 2.844441; 0.621953;, 
   -0.112022; 2.844441; 0.621953;, 
   -0.419226; 5.831111; -0.182925;, 
   -0.726429; 5.831111; -0.475608;, 
   -0.649628; 2.844441; 0.256099;, 
   -0.649628; 2.844441; 0.256099;, 
   -0.726429; 5.831111; -0.475608;, 
   -0.496027; 5.831111; -0.914630;, 
   -0.342425; 2.844441; -0.475608;, 
   -2.078437; 6.826662; -0.980485;, 
   -1.848034; 7.039996; -0.907315;, 
   -0.265620; 6.186663; -0.841465;, 
   -0.496020; 5.831107; -0.914635;, 
   -0.726420; 5.831107; -0.475605;, 
   -0.496020; 6.186663; -0.329265;, 
   -2.001636; 7.039996; -0.614635;, 
   -2.232038; 6.826662; -0.687805;, 
   -1.848034; 7.039996; -0.907315;, 
   -2.001636; 7.039996; -0.614635;, 
   -0.496020; 6.186663; -0.329265;, 
   -0.265620; 6.186663; -0.841465;, 
   -2.232038; 6.826662; -0.687805;, 
   -2.078437; 6.826662; -0.980485;, 
   -0.496020; 5.831107; -0.914635;, 
   -0.726420; 5.831107; -0.475605;, 
   -3.216052; 7.857778; -1.960979;, 
   -3.139251; 7.999998; -1.887808;, 
   -1.848040; 7.040000; -0.907320;, 
   -2.078440; 6.826667; -0.980491;, 
   -2.232040; 6.826667; -0.687808;, 
   -2.001640; 7.040000; -0.614637;, 
   -3.254452; 7.999998; -1.778052;, 
   -3.331253; 7.857778; -1.851223;, 
   -3.139251; 7.999998; -1.887808;, 
   -3.254452; 7.999998; -1.778052;, 
   -2.001640; 7.040000; -0.614637;, 
   -1.848040; 7.040000; -0.907320;, 
   -3.331253; 7.857778; -1.851223;, 
   -3.216052; 7.857778; -1.960979;, 
   -2.078440; 6.826667; -0.980491;, 
   -2.232040; 6.826667; -0.687808;, 
   -3.331251; 7.857780; -1.851221;, 
   -3.254451; 8.000001; -1.778051;, 
   -3.139249; 8.000001; -1.887801;, 
   -3.216050; 7.857780; -1.960971;, 
   0.195180; 6.826667; 1.134149;, 
   0.118380; 7.004443; 0.914637;, 
   -0.496030; 6.186667; -0.329267;, 
   -0.419220; 5.831112; -0.182925;, 
   -0.035220; 5.831112; -0.329267;, 
   0.041580; 6.186667; -0.585364;, 
   0.502390; 7.039999; 0.841466;, 
   0.540790; 6.826667; 1.060979;, 
   0.118380; 7.004443; 0.914637;, 
   0.502390; 7.039999; 0.841466;, 
   0.041580; 6.186667; -0.585364;, 
   -0.496030; 6.186667; -0.329267;, 
   0.540790; 6.826667; 1.060979;, 
   0.195180; 6.826667; 1.134149;, 
   -0.419220; 5.831112; -0.182925;, 
   -0.035220; 5.831112; -0.329267;, 
   0.041579; 6.186670; -0.585365;, 
   -0.035222; 5.831110; -0.329267;, 
   -0.035222; 5.831110; -0.768291;, 
   1.424000; 6.328887; -1.939011;, 
   1.308799; 6.577775; -1.682914;, 
   0.041580; 6.186664; -0.585360;, 
   -0.035220; 5.831109; -0.768280;, 
   -0.496030; 5.831109; -0.914620;, 
   -0.265620; 6.186664; -0.841450;, 
   1.078396; 6.648886; -1.902426;, 
   1.116797; 6.435554; -2.231695;, 
   1.308799; 6.577775; -1.682914;, 
   1.078396; 6.648886; -1.902426;, 
   -0.265620; 6.186664; -0.841450;, 
   0.041580; 6.186664; -0.585360;, 
   1.116797; 6.435554; -2.231695;, 
   1.424000; 6.328887; -1.939011;, 
   -0.035220; 5.831109; -0.768280;, 
   -0.496030; 5.831109; -0.914620;, 
   0.041578; 6.186670; -0.585365;, 
   -0.265625; 6.186670; -0.841462;, 
   -0.496027; 6.186670; -0.329267;, 
   -0.496026; 6.186668; -0.329267;, 
   -0.726429; 5.831108; -0.475608;, 
   -0.419225; 5.831108; -0.182925;, 
   0.771190; 6.968892; 3.000000;, 
   0.771190; 7.146670; 2.963410;, 
   0.118380; 7.004447; 0.914630;, 
   0.195180; 6.826669; 1.134143;, 
   0.540780; 6.826669; 1.060972;, 
   0.502380; 7.040002; 0.841460;, 
   0.886390; 7.182225; 2.890240;, 
   0.924790; 7.004447; 2.890240;, 
   0.771190; 7.146670; 2.963410;, 
   0.886390; 7.182225; 2.890240;, 
   0.502380; 7.040002; 0.841460;, 
   0.118380; 7.004447; 0.914630;, 
   0.924790; 7.004447; 2.890240;, 
   0.771190; 6.968892; 3.000000;, 
   0.195180; 6.826669; 1.134143;, 
   0.540780; 6.826669; 1.060972;, 
   0.924784; 7.004442; 2.890246;, 
   0.886384; 7.182220; 2.890246;, 
   0.771182; 7.146665; 2.963416;, 
   0.771182; 6.968887; 2.999996;, 
   2.000004; 7.573330; -2.963413;, 
   1.846403; 7.680000; -2.890243;, 
   1.308797; 6.577777; -1.682920;, 
   1.423998; 6.328889; -1.939020;, 
   1.116795; 6.435555; -2.231710;, 
   1.078394; 6.648889; -1.902440;, 
   1.692801; 7.608890; -2.926828;, 
   1.808002; 7.502222; -2.999999;, 
   1.846403; 7.680000; -2.890243;, 
   1.692801; 7.608890; -2.926828;, 
   1.078394; 6.648889; -1.902440;, 
   1.308797; 6.577777; -1.682920;, 
   1.808002; 7.502222; -2.999999;, 
   2.000004; 7.573330; -2.963413;, 
   1.423998; 6.328889; -1.939020;, 
   1.116795; 6.435555; -2.231710;, 
   1.807999; 7.502230; -2.999990;, 
   1.692789; 7.608890; -2.926823;, 
   1.846399; 7.680000; -2.890238;, 
   1.999999; 7.573340; -2.963410;;   // Ende Vertices

   40; // Faces FORMAT [ AnzVerts;Vertex1,Vertex2,...;, ]
   4;0,1,2,3;, 
   4;4,5,6,7;, 
   4;8,9,10,11;, 
   4;12,13,14,15;, 
   4;16,17,18,19;, 
   4;20,21,22,23;, 
   4;24,25,26,27;, 
   4;28,29,30,31;, 
   4;32,33,34,35;, 
   4;36,37,38,39;, 
   4;40,41,42,43;, 
   4;44,45,46,47;, 
   4;48,49,50,51;, 
   4;52,53,54,55;, 
   4;56,57,58,59;, 
   4;60,61,62,63;, 
   4;64,65,66,67;, 
   4;68,69,70,71;, 
   4;72,73,74,75;, 
   4;76,77,78,79;, 
   4;80,81,82,83;, 
   4;84,85,86,87;, 
   4;88,89,90,91;, 
   3;92,93,94;, 
   4;95,96,97,98;, 
   4;99,100,101,102;, 
   4;103,104,105,106;, 
   4;107,108,109,110;, 
   3;111,112,113;, 
   3;114,115,116;, 
   4;117,118,119,120;, 
   4;121,122,123,124;, 
   4;125,126,127,128;, 
   4;129,130,131,132;, 
   4;133,134,135,136;, 
   4;137,138,139,140;, 
   4;141,142,143,144;, 
   4;145,146,147,148;, 
   4;149,150,151,152;, 
   4;153,154,155,156;;   // Ende Faces 

   MeshMaterialList { 
      1;  // Materials benutzt 
      40; // Faces mit Material 
      0,   // Material for face 0 
      0,   // Material for face 1 
      0,   // Material for face 2 
      0,   // Material for face 3 
      0,   // Material for face 4 
      0,   // Material for face 5 
      0,   // Material for face 6 
      0,   // Material for face 7 
      0,   // Material for face 8 
      0,   // Material for face 9 
      0,   // Material for face 10 
      0,   // Material for face 11 
      0,   // Material for face 12 
      0,   // Material for face 13 
      0,   // Material for face 14 
      0,   // Material for face 15 
      0,   // Material for face 16 
      0,   // Material for face 17 
      0,   // Material for face 18 
      0,   // Material for face 19 
      0,   // Material for face 20 
      0,   // Material for face 21 
      0,   // Material for face 22 
      0,   // Material for face 23 
      0,   // Material for face 24 
      0,   // Material for face 25 
      0,   // Material for face 26 
      0,   // Material for face 27 
      0,   // Material for face 28 
      0,   // Material for face 29 
      0,   // Material for face 30 
      0,   // Material for face 31 
      0,   // Material for face 32 
      0,   // Material for face 33 
      0,   // Material for face 34 
      0,   // Material for face 35 
      0,   // Material for face 36 
      0,   // Material for face 37 
      0,   // Material for face 38 
      0;;  // Material for face 39 
      { Standardac2x_1 } 
      } // MeshMaterialList 

   MeshTextureCoords { 
      157; // Koordinaten Paare 
      0.000000; 0.000000;, 
      0.370370; 1.000000;, 
      1.000000; 1.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.000000;, 
      0.000000; 1.000000;, 
      0.416667; 1.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.000000;, 
      0.764706; 0.240000;, 
      1.000000; 0.640000;, 
      0.235294; 1.000000;, 
      1.000000; 0.000000;, 
      0.769231; 0.722222;, 
      0.500000; 1.000000;, 
      0.000000; 0.666667;, 
      0.315789; 0.000000;, 
      1.000000; 1.000000;, 
      0.473684; 0.888889;, 
      0.000000; 0.722222;, 
      0.357143; 0.000000;, 
      0.000000; 1.000000;, 
      0.642857; 1.000000;, 
      1.000000; 0.000000;, 
      0.357143; 0.000000;, 
      0.000000; 1.000000;, 
      0.642857; 1.000000;, 
      1.000000; 0.000000;, 
      0.357143; 0.000000;, 
      0.000000; 1.000000;, 
      0.642857; 1.000000;, 
      1.000000; 0.000000;, 
      0.357143; 0.000000;, 
      0.000000; 1.000000;, 
      0.642857; 1.000000;, 
      1.000000; 0.000000;, 
      0.357143; 0.000000;, 
      0.000000; 1.000000;, 
      0.642857; 1.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.000000;, 
      0.400000; 1.000000;, 
      1.000000; 1.000000;, 
      0.599999; 0.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      1.000000; 0.583333;, 
      0.000000; 0.000000;, 
      0.000000; 1.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      1.000000; 0.750000;, 
      0.000000; 1.000000;, 
      0.000000; 0.000000;, 
      1.000000; 0.583333;, 
      0.000000; 0.000000;, 
      0.000000; 1.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.000000;, 
      0.400000; 1.000000;, 
      1.000000; 1.000000;, 
      0.599999; 0.000000;, 
      0.000000; 0.823529;, 
      0.166667; 1.000000;, 
      1.000000; 0.294118;, 
      0.833333; 0.000000;, 
      0.777778; 0.000000;, 
      1.000000; 0.294118;, 
      0.111111; 1.000000;, 
      0.000000; 0.823529;, 
      0.000000; 1.000000;, 
      0.333333; 1.000000;, 
      1.000000; 0.000000;, 
      0.416667; 0.000000;, 
      0.363636; 1.000000;, 
      0.000000; 1.000000;, 
      0.454545; 0.000000;, 
      1.000000; 0.000000;, 
      0.000000; 0.000000;, 
      0.400000; 1.000000;, 
      1.000000; 1.000000;, 
      0.599999; 0.000000;;   // Ende Texturkoordinaten
      } // MeshTextureCoords 
   } // Mesh 
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Have you resaved it from DX meshviewer. Irrlciht takes most meshes that DX mesh viewer saves
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Electron wrote:Have you resaved it from DX meshviewer. Irrlciht takes most meshes that DX mesh viewer saves
Indeed, it has to be re-saved in text-format, not binary.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

his already is text format, if he posted a binary formatted x file it would look like gobbledygook. However, irrlicht is picky even about which text .x files it takes
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

You're right :). The point is he has to resave it in MeshViewer.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

Thanks, i'll resave it
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
DrBenito
Posts: 35
Joined: Mon Jul 19, 2004 8:50 pm
Location: Newcastle, UK
Contact:

Post by DrBenito »

I had a similar problem but figured it out while tweaking the options in Panda exporter...

If you look at the text file above it's down to the Material definition not being inlined within the Mesh definition. Irrlicht doesn't currently recognise stand alone Materials.

Code: Select all

Material Standardac2x_1 { 
...
}
Wheras the inline version:

Code: Select all

Mesh  {
...
  MeshMaterialList  {
    ...
    Material bobit {
      0.596078;0.596078;0.976471;1.000000;;
      3.200000;
      0.000000;0.000000;0.000000;;
      0.000000;0.000000;0.000000;;
     }
  }
}
...works fine. :)

HTH
Ben
Post Reply