It is composed by cubes side by side (7x7). But rahter than creating as many cubes as cells in the board i would like to create a box with te right size an apply correctly a texture to repeat the pattern of the cells.
The problem is that i do not know how to manipulate textures coord.
here is what i've done :
Node boardNode=null;
boardNode= new Node("MyBoardNode");
Box b = new Box("BoardBox", new Vector3f(0, 0, 0), 3.5f, 3.5f, .5f);
boardNode.attachChild(b);
URL textu=DiceUI.class.getClassLoader().getResource("resources/models/board.bmp");
TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts.setEnabled(true);
Texture texture = TextureManager.loadTexture(
textu,
Texture.MM_LINEAR,
Texture.FM_LINEAR);
ts.setTexture(texture);
boardNode.setRenderState(ts);
TextureManager.releaseTexture(texture);
diceNode.updateRenderState();
Ok, for me box seems not to be Your optimal solution here.
Here's what the doc's stat about box's texture coord gen:
[pre]
/**
*
<code>setTextureData</code> sets the points that define the texture of
the box. It's a one-to-one ratio, where each plane of the box has it's
own copy of the texture. That is, the texture is repeated one time for
each six faces.
*
*/
[/pre]
so if i get this right, You would get a box with the assigned texture (checkerboard) repeated on each side of the box (scaled to fit).
If thats not what You want, i'd be creating my own box class holding four quads with different textures like skybox or simply add a quad with the checkerboard texture slightly above the box.