Starting Terrain generating

I’m going to start making terrain, when I am done with each one I will make it so you can download it.

How are you going to generate the terrain?

Looking for a tutorial myself, anything good out there that can be done without paid software (Photoshop, etc)?

I’m just playing but I created this today.

Because it’s procedural, you can’t (currently) see the geometry in the 3D view of the Editor. Also, the pc.createMesh function doesn’t currently handle the case where meshes can have >65535 vertices (this is a bug) so the number of subdivisions should currently be set to around 250 or less. Anyway, an interesting starting point! :smile:

1 Like

Hi, I’ve been working on 3D terrain generation stuff with PlayCanvas for a while on my free time, and now finally finished a write-up about what I’ve got working. It’s MIT licensed, hopefully it’s of some use to somebody!

here’s a link to the post so it doesn’t get inlined

here’s the source: https://github.com/Tsarpf/proced

P.S. making the meshes collidable is at the moment the biggest problem. When I try to do it like here: http://answers.playcanvas.com/questions/579/how-can-you-have-collisions-with-a-generated-mesh/582 the meshes have to be really small or the tab crashes with a stack overflow IIRC.

2 Likes

Wow, impressive stuff @tsarpf! Collision mesh generation can be a bit slow, which is why it’s best to generate a collision mesh at a lower resolution compared to your renderable mesh. Check this example out for a demonstration:

https://playcanvas.com/project/362224/overview/tutorial-terrain-from-heightmap

By the way, are you on Twitter? If you tweet about this, we’ll share it! :smiley:

That’s a cool stuff!

Regarding optimisations, indeed, web workers can bring significant benefits to reduce freezing of main execution thread.

hi, i use the terrain generator in my project and just noticed that my character tilt forward or backward while walking, when i click again it goes back straight and slowly tilt again…with flat terrain no prob. any idea?

Is the problem because your player rigid body needs linear factor set to 1, 1, 1 and angular factor set to 0, 0, 0?

No the set is 1,1,1 - 0,0,0. I think it’s due to the terrain that’s not flat or to the code when player walk around coz it keep tilting but just back and forward not sideways.