Skip to main content
GameDev.net gamedev.net
🔒 Locked

Procedurally Generating A Planet!!!

Started by EmptyVoid Jun 14, 2007 at 12:41 AM 4 replies 1.5k views
Original Post
EmptyVoid
EmptyVoid
So I need I math formula that does this But with a 3D normal. basically I need it for terrain it needs to be based on a number which when changed also changes the terrain like a seed value. and it needs to return a single value which is the distance form the center of the planet form the x y and z coordinates of the normal. And I am sorry for putting this here I know it should go in the math part of the forum but I was not thinking how mathematic my question was until after I already typed it now I don't fill like retyping it so if you need to move it be my guest.
This is your life, and it's ending one minute at a time. - Fight club
wyrzy
wyrzy
Perlin + fractal noise can give pretty nice results from my experience. If you want to generate it over a sphere, just displace each vertex on the sphere in the direction of the original vertex normal (calculating the original normal should be straightforward).

Also, if you own Photoshop, I think there's some filters to do something similar. I don't use Photoshop though so I'm not really an expert on this.

Beyond that, "Procedural Texturing and Modeling" has some nice algorithms with code (on the website) for terrain generation.

Now, if you're planning on zooming extremely far out and want something that looks like earth, well, I'm not sure if this technique will suffice. You can try it though, it might be acceptable for what you're doing.

EDIT:
I think I missed the point about computing the normal. I would just manually recompute all the normals in the mesh after generating the new verticies. That should work, right?
superpig
superpig
Last time I wrote a landscape generator I just used a sum of sine waves at different frequencies/amplitudes.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Raghar
Raghar
Your image wasn't a planet, it wasn't even height map of a planet surface. If you'd like to look at some images: This page has some starting points

Of course, you'd need something more, so after you'd guess some algorithms that could make similar results, you might come for more pointers. Note that above mentioned page shows only results of first three days of work, so you could try to be better.
EmptyVoid
EmptyVoid
can someone just show me a math example with a one dimensional random sin wave like the one above?
This is your life, and it's ending one minute at a time. - Fight club
EmptyVoid
EmptyVoid
can someone just show me a math example with a one dimensional random sin wave like the one above?
This is your life, and it's ending one minute at a time. - Fight club

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.