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
Rogk generation algorithm
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.
____________________ ____ ___ __ _
Enselic''s Corner
for each vertex: v.x += rand( -1.0f, 1.0f ) * factor etc...
____________________ ____ ___ __ _
Enselic''s Corner
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!
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!
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
My Home Page
Ted Zuvich
My Home Page
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement