Box Grid layout


I’m not sure if this has been answered before but lets say you want to make a simple grid of 10x10 1 scale boxes.

Is it advised to simply use the following:

[java]Box boxBlock = new Box( Vector3f.ZERO, 1,1,1);

//repeat following for each seperate block

Geometry block = new Geometry(“Box”, boxBlock);

block.move(x,y,z); // change

//end repeat[/java]

So is it possible to create one block and repeat the Geometry creation? Or does a new block need to be created for each Geometry?


Does the Move function needs to be called for it’s position? Or is there a constructor or an easier way to create and place a block?

Kind regards

Without even looking at an answer to the question (I’m not sure the answer) I can say that the whole approach is not advisable simply because 100 objects with 8 vertices place massively more load on the system than 1 object with 800 vertices (which is compounded by the fact that you could most likely merge or even remove entirely some of those 800 vertices).

If you are trying to make a box world read up on voxels and voxel terrain.

Well it wont be an infinite terrain but rather a 3D Boardgame.

Yet offcourse it will surpase the 100 objects. I’m not sure if you ever played Memoir44 but it will contain such scenery (in height).

So when I checked voxel terraining this would rather be used for huge terrains. Or is it still applicable?

Voxel describes a way of doing things, not a scale. Take a look at Maker’s Tale for example. It’s a JME3 project creating a board game and using (hexagonal) voxel terrain.