Procedural Rock Generator - Any ideas?

Hey guys,

I was looking for some 3D-Rock-Models for another project, but quickly found out that I need a lot of them,
so I was wondering if it’s possible to generate them procedural and export the .obj files :nerd_face:

Here is a small scratch:
https://playground.babylonjs.com/#345DWH#3

The result is quite bad, probably because of my lack of skills in geometry and 3D-Graphics :sweat_smile:
So maybe some of you guys could point me in the right direction here?

How I do it:

  • Create a Sphere-Mesh with Random diameters
  • use the forceSharedVertices()-method to prevent seams (due the next step)
  • add some noise to the vertices
  • add a displacementMap which uses the “distortion.png” from our PG-assets

An other nice web-gl example which works way better then mine (still not perfect imho) can be found here:
http://erkaman.github.io/gl-rock/example/index1.html

Maybe the project is too ambitious for me…will be hard to get a variety of rocks like in these examples:
stones

Your thoughts and help are appreciated :upside_down_face:

1 Like

Maybe that can help: http://www.diva-portal.org/smash/get/diva2:817559/FULLTEXT01.pdf

There are a number of references at the end of the doc, too.

3 Likes

wow this is awesome! :slightly_smiling_face:

I’m late to the party, but your issue is that you’re using a sphere. Switching it to an isosphere instantly improves it 1000%. It’s the vector shared by From there, more tweaks to the displacement map can turn this into a damn nice set of rocks.

var sphere = BABYLON.MeshBuilder.CreateIcoSphere(“sphere”,
{
subdivisions: 5,
radiusX: Math.random() * 1.5,
radiusY: Math.random() * 1.5,
radiusZ: Math.random() * 1.5,
updatable:true
}, scene);

Also, sorry for necro-posting. Procedural modeling just isn’t a common topic in Babylon yet.

2 Likes