Procedural Terrain - Flat Ground

Hey guys,



I’m very interrested in procedural “endless” Terrains in JME. Allthough the alghorithms aren’t really easy :stuck_out_tongue: So I just wanted to try to make basically an endless “flat” ground. But I have no idea how to implement it. I have created a flat cube and a first person control. Now if I walk forward (basically on the Z axis) i want the cube to continue so that the user has the impression to walk on an endless floor.



I hope you understand what I want and could give me some starting advise. (And yeah, I’m a beginner in jME but I freakin’ love it :D)



Thanks :slight_smile:

I’ll give you my code for generating terrain if you want something to poke through.



Just remove the calls to the noise function and you have flat terrain.



I think it’s fairly easy to understand. It is not endless atm, because I haven’t added a paging system. But (minus this) it has everything needed to do that:



3 levels of detail swapped out by distance.

Shows you how to generate the meshes

Has a straightforward way of recalculating normals (though if its flat… no need to do that either)

Calculates the texture mapping coords, etc.



Anyways… it’s 3 classes including the noise function… really easy to get running…



[java]// terrainSize = maximum view distance

// gridSize = how many grid quads make up a full terrain tile

// gridQuadSize = the actual size of each quad

Terrain x = new Terrain(terrainSize, gridSize, gridQuadSize); // and your done…[/java]



Let me know if it would be helpful.

Yeah, you haven’t even looked at the tutorials I guess, there is one called “Endless Terrain”…