
to frost:
I think this is a zBuffer problem. I use wBuffering, but it seems not to work quite well with those ATI cards. I hope to be able to fix this today...
to John S.
this is really not that difficult. I am not at home, so I cant post you the exact function, but I can explain how it works.At first I create spheres with something like:
f(x, y).x = (sin(x*2*Pi) * abs(sin(y*Pi)),
f(x, y).y = sin(y*Pi),
f(x, y).z = cos(x*2*Pi) * abs(sin(y * Pi)))
I am not sure whether this is correct, but I hope you know what I mean, its just a simple sphere tesselation.
Then I perform some parameterized "noise":
x = p1 * x * (y + p2 * z); // this is just an example, the real thing doesnt look like that
y = ...
z = ...
And then for every stone I only have to store the parameters (I think its three parameters that were randomly created at startup).
When it comes to tesselation, I simply put a regular grid over a [0,1]x[0,1] texture (this is also the texture coordinates).
To calculate the positions in 3D I simply calculate f(x, y) on those coordinates and get the positions in 3D.
For now, I only put a regular grid over the texture, but you may of course use any tesselation of a plane, and then I can also create planets (for the Planets I will of course use a different function, to generate real mountains and so on)
