Texture for Character.3ds

I load the Character Model from the jmetest samples like


private void loadModel() {
        MaxToJme maxToJme = new MaxToJme();
        Node node = null;
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        BinaryImporter binaryImporter = new BinaryImporter();
        URL url = SceneAvatar.class.getClassLoader().getResource("res/model/Character.3DS");


        System.out.println(url);
        InputStream is = null;

        try {
            is = url.openStream();
        } catch (Exception ex) {
            System.out.println("Could not load model file");

        }
        try {
            ResourceLocatorTool.addResourceLocator(
                    ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(SceneAvatar.class
                            .getClassLoader().getResource(
                                    "res/model/")));
        } catch (URISyntaxException e1) {
            logger.log(Level.WARNING, "unable to setup texture directory.", e1);
        }
        try {
            maxToJme.convert(is, byteArrayOutputStream);
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
            node = (Node) binaryImporter.load(byteArrayInputStream);
        } catch (IOException ex) {
            System.out.println("Error loading Model");
        }

        if (url != null && node != null) {
            //System.out.println("loaded");
            node.setName("Model");
            node.setLocalScale(0.01f);
            node.setModelBound(new BoundingSphere());
            node.updateModelBound();

            node.updateRenderState();
            attachChild(node);
        }
    }



But my displayed Character is without textures? How do I get them?

if its just plain white, you need to attach a lightState to the scene.

I had no light state (thanks for the tipp), but even with activating and attaching to scene its still white?



 /**
     * creates a light for the terrain.
     */
    private void buildLighting() {
        /** Set up a basic, default light. */
        DirectionalLight light = new DirectionalLight();
        light.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setDirection(new Vector3f(1,-1,0));
        light.setEnabled(true);

          /** Attach the light to a lightState and the lightState to rootNode. */
        LightState lightState = display.getRenderer().createLightState();
        lightState.setEnabled(true);
        lightState.attach(light);
        scene.setRenderState(lightState);
    }



What else could I check

hmm that should do it pretty much, make sure to call rootNode.updateRenderstate() after everything has been attached to it.



if it still doesn’t work, try to use the SceneMonitor, maybe you see whats missing

Make sure you have the good texture name because 3DS export truncate the name with maximum 10 characters and change them in uppercase. This might be a problem but if it doesn't find textures I suppose it should throw an exception or replace textures by a "Missing Texture".

It was my understanding it was necessary to have a uv mapped model and apply textures with a texture state. Perhaps I am crazy?

Some of the importers do it for you. Can't speak for the 3DS one though.