7
\$\begingroup\$

I'm looking to create some procedural low poly rocks and boulders for a game.

Here is an example of what I would like to achieve

I haven't found much interesting information on the internet other than 3D software articles. Not sure what way to go.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Like @jackmott suggested you could use a sphere. But I would also suggest using a randomized height map on the sphere. You could create a "sample" rock height map and then randomize from there. \$\endgroup\$ Commented Jan 29, 2016 at 6:15
  • 1
    \$\begingroup\$ You definitely should check a brilliant website by procedural genius Inigo Quilez: iquilezles.org. Also see his shadertoy.com. \$\endgroup\$ Commented Feb 11, 2016 at 14:34
  • 1
    \$\begingroup\$ Philip Rideout's par_shapes.h single-file library for parametric meshes has a rock generation algorithm based on simplex noise. You may be able to derive some inspiration from the implementation. \$\endgroup\$ Commented Feb 11, 2016 at 15:49

2 Answers 2

4
\$\begingroup\$

One approach could be to start with a sphere, perhaps pick some random parameters to stretch it varying amounts so some rocks are roughly round, while others are roughly egg shaped, then use 3D perlin or simplex noise and it's fractal variants (see the fbm methods in the link) to push vertices in towards the center, or pull them out, by some multiple of the perlin noise result. You would just pass the 3d coordinate of each vertex to the 3d perlin noise function, get back a float in the range [0,1], and use that to push or pull the vertex.

If you let me know what environment/language you are working with I can go into more detail.

\$\endgroup\$
2
  • \$\begingroup\$ I'm using C++ and Direct3D. I started out trying to modify a point cloud convex hull but the results are not very good. I'm going to try what has been suggested here and start from a sphere. \$\endgroup\$ Commented Jan 29, 2016 at 16:33
  • \$\begingroup\$ I've got some handy perlin noise code in c++ here: github.com/jackmott/FastNoise-SIMD though if the spheres are low poly enough it might make more sense just to do some random displacements of verticies. Using noise would be overkill. \$\endgroup\$ Commented Jan 29, 2016 at 16:37
3
\$\begingroup\$

When I create rocks in modelling softwares, I start from an icosaeder, fhen stretch it around, scale it a nit, then I just pick random vertices and I pull them a bit out. I suppose, the same can be made with code

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.