[SOLVED] Multiple Textures


I’m relatively new to jMonkeyEngine and I want to create a Box object with a “grassy” texture.

I want it to have a green texture on the top and a brown texture around all the other sides (all loaded from files).

How would I go about doing this? I’ve looked everywhere but I can’t find much good information.

Thanks in advance.

EDIT: I found the “MultiFaceBox” class in the JavaDoc, but I’m not sure on how to use it… An description of what “1 Unit wide and 8 Units high” means (what is a unit) would be great.

You can create a box model, where the top is separate from the bottom. You can then load the model in jME and apply different textures to different parts of the model by retrieving the corresponding geometries using Node.getChild().

That might work, but I’d prefer to use one of the existing classes… Also, I need some clarification on whether MultiFaceBox would be any good here.

MultiFaceBox allows you to have a single texture with 6 parts to be laid out on a box. Since you said you wanted separate textures, I don’t think that would work.

If by “6 parts to be laid out on a box” you mean one on each side, then that would very much work (all I need to do is combine my images), and I think it would be easier than making a model and all of that stuff.

Thankyou Momoko Fan for helping, I worked out how to get MultiFaceBox working.

Once again, thanks.