Applying texture to just some of the faces of a Mesh

This is probably a really noob question but I am doing some fairly rudimentary work with the JMonkeyEngine and am trying to build a 3D object programatically from a mesh. I have some familiarity with OpenGL i.e. native programming of OpenGL with C but am still learning JME2.



The question I have is whether it is possible with a mesh to apply a texture to only certain faces of the mesh or whether the nature of a mesh is that a texture is inherently applied to the entire mesh? I have a simple box shaped object but I only want to put a texture on one side of the box (i.e. two of the triangle faces) and leave the rest un textured.



If an entire Mesh is textured together then I would guess the solution is to use one mesh for the textured face and another mesh for the rest of the un textured faces.



Another somewhat related question regarding meshes is about the arguments used to create them (which don’t have a lot of documentation). I know OpenGL is state based so that i.e. if you set a colour that colour will be set until it is changed to something else. The same goes for normals etc. There are several float buffers supplied to a Mesh containing the vertices, normals, colours and texture coordinates. I don’t know if all of them are required in all cases. For example, do texture coordinates still need to be supplied even if an object is not intended to be textured? Is it required to have a float buffer with one colour per vertex even if all the vertices are the same colour?



If that is the case, it is ok I just wanted to be clear on that because the API documentation doesn’t seem very specific about that.

Yes, one Geometry has one Material which in turn can have multiple textures, but only if the shader supports that. Normal materials only have one map per function (diffuse, normal etc.) Its not efficient pushing multiple files per object through the graphics card, use UV maps.