#### Archived

This topic is now archived and is closed to further replies.

# Rogk generation algorithm

This topic is 5618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does anyone happen to have (or know of) a reasonable algorithm for generating 3D rocks? I want to start with either a spherical or cylindrical mesh as a base, then perturb it through some process until it is a realistic rock shape. Ted Zuvich Home Page

##### Share on other sites
I have not done this but one way would be to displace each vertex a bit in a random direction. To make this look somewhat realistic you probably need very low polygon baseobject.
for each vertex:    v.x += rand( -1.0f, 1.0f ) * factor    etc...

____________________ ____ ___ __ _
Enselic''s Corner

##### Share on other sites
I wouldn''t suggest using the random approach, although it could work, if you used a variation of Perlin noise. That wouldn''t give anything with a proper surface though. One way could be to start with a base object. Now cut pieces off, then smooth if necessary, then maybe cut more pieces off. This would simulate erosion and how rocks are actually formed. By varying the spliting and smoothing, you could create different kinds of rocks.

However this would only create convex high poly rocks. If you''re looking for low poly, then an approach similar to the first suggestion would probably be better.

To slice a rock, you would create a plane, then disregard all vertices on one side, create vertices along split edges and then work out the faces.

Good Luck!

##### Share on other sites
The random displacement idea doesn''t work very well ( I already tried it ). I''ll try the plane-slicing idea; sort of an analogy to the fault-generation algorithm used to generate terrain blocks. Thanks for the replys.

Ted Zuvich

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 9
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633717
• Total Posts
3013513
×