Creating 'Cube' Terrain

Hi,



I want to create 'cubed' terrain, by which I mean, instead of:



         ________
        /
_______/



I want:


        ______
       |
_______|



Another way of putting it, I'd like the terrain to look like it was made out of nothing by cubes.  Mountains would look like a series of steps rather than a nice smooth gradient.

I was wondering what would be the easiest way to accomplish this?  Since I know nothing about geometry creation, would it be better to start from scratch or attempt to hack the Terrainblock class?  I'll want to make edits to the terrain after it's created as well, so I really need to understand what's going on.

BTW I'm planning on using jME-2.0pa, just in case that's in any way relevant.

In that case then - make it from Cubes ???



Optimisation, have a standard node contain say 4 * 4 cubes, lock it of course, then have a quad tree to maintain the nodes ??

Is it possible to join several meshes into one? like add 2-3 cubes next to each other… and then merge them into 1?



Or would it not offer a performance gain over just locking?

That is possible, but I think the overhead will be minimal if lists are created via locking. By not merging them it also makes it easier to develop code to alter the terrain at runtime… Each cube can have a simple location key to assist when picking. Can always optimise later if its an issue.


theprism said:

In that case then - make it from Cubes ???


I thought about this but assumed (perhaps quite foolishly) that it would be a performance killer as I'd have what; three times as many vertices as a normal terrain?

Perhaps I should stop asking stupid questions and just knock out a proof of concept  :|

Can you tell us WHY you want this functionality… I am just curious :slight_smile:

Mindgamer said:

Can you tell us WHY you want this functionality... I am just curious :)


Purely for the visual style of the game  :)

For anyone who’s interested here’s a screenie of what I’ve got so far  :slight_smile:



Oh and as far as performance goes it's about 6x slower than normal terrain at the moment  :expressionless:

Cool! I wonder what it would look like if it was hovering squares on a dark background…



Would sharedmesh help?

In the ideal case you would be using twice as many verticles and 5 times more faces than regular terrain. That is, if all geometry is stored in one mesh and you have some algorithm to optimize sharing of verticles…