Material loading with the ASE loader

I’m using the ASE loader for Xith, and everything works as expected for geometry that uses bitmap textures, but geomtry that uses materials that don’t use a bitmap diffuse map show up in Xith as white filled outlines.

Here’s a screenshot:

http://imagehost.5gigs.com/uploads2/screenshot.JPG

The white sphere at the top of the big cube is supposed to be blue (blue diffuse color and everything in 3ds max, and I checked the ASE file too), but it shows up completely white. Applying a blue, light-affected material to it and then adding lights (in Xith) makes it display nicely, but is there a way to make it display like how it’s supposed to, based on the ASE file, and not an artificial Material added using Xith? Apparently, the ASE loader only loads bitmaps for textures??

Here’s the material list in the ASE file:

*MATERIAL_LIST {
*MATERIAL_COUNT 2
*MATERIAL 0 {
*MATERIAL_NAME “matBox”
*MATERIAL_CLASS “Standard”
*MATERIAL_AMBIENT 1.0000 0.0000 0.0000
*MATERIAL_DIFFUSE 1.0000 0.0000 0.0000
*MATERIAL_SPECULAR 1.0000 1.0000 1.0000
*MATERIAL_SHINE 0.1000
*MATERIAL_SHINESTRENGTH 0.0000
*MATERIAL_TRANSPARENCY 0.0000
*MATERIAL_WIRESIZE 1.0000
*MATERIAL_SHADING Blinn
*MATERIAL_XP_FALLOFF 0.0000
*MATERIAL_SELFILLUM 0.0000
*MATERIAL_FALLOFF In
*MATERIAL_XP_TYPE Filter
*MAP_DIFFUSE {
*MAP_NAME “mapBox”
*MAP_CLASS “Bitmap”
*MAP_SUBNO 1
*MAP_AMOUNT 1.0000
*BITMAP “C:\java\projects\Xith3DTest\MtlPlat2.jpg”
*MAP_TYPE Screen
*UVW_U_OFFSET 0.0000
*UVW_V_OFFSET 0.0000
*UVW_U_TILING 1.0000
*UVW_V_TILING 1.0000
*UVW_ANGLE 0.0000
*UVW_BLUR 1.0000
*UVW_BLUR_OFFSET 0.0000
*UVW_NOUSE_AMT 1.0000
*UVW_NOISE_SIZE 1.0000
*UVW_NOISE_LEVEL 1
*UVW_NOISE_PHASE 0.0000
*BITMAP_FILTER Pyramidal
}
}
*MATERIAL 1 {
*MATERIAL_NAME “matSphere”
*MATERIAL_CLASS “Standard”
*MATERIAL_AMBIENT 0.0000 0.0000 1.0000
*MATERIAL_DIFFUSE 0.0000 0.0000 1.0000
*MATERIAL_SPECULAR 1.0000 1.0000 1.0000
*MATERIAL_SHINE 0.2500
*MATERIAL_SHINESTRENGTH 1.0000
*MATERIAL_TRANSPARENCY 0.0000
*MATERIAL_WIRESIZE 1.0000
*MATERIAL_SHADING Blinn
*MATERIAL_XP_FALLOFF 0.0000
*MATERIAL_SELFILLUM 0.0000
*MATERIAL_FALLOFF In
*MATERIAL_XP_TYPE Filter
}

And the code fragment that loads up the sphere and cube:

        AseFile af = new AseFile();
        AseReader r = null;
        try {
              r = new AseReader(new BufferedReader(new FileReader("BoxSphereTest.ase")));
        }
        catch(IOException e) {
              System.out.println("Error reading ASE file.");
        }
        af.parse(r);
        TransformGroup boxSphereTG = new TransformGroup();
        Transform3D trans = new Transform3D();
        trans.setScale(0.1f);
        boxSphereTG.setTransform(trans);
        objRotate.addChild(boxSphereTG);
        boxSphereTG.addChild(af.getModel());

This has been discussed previously.

Materials are 3DS MAX specific. While the loader might be able to support colours (one component of a “Material”) - it doesn’t.

The answer? use textures.

Will.

Okay thanks. :slight_smile: