Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Random Planet Generator

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 20:29 Edited at: 25th Sep 2007 20:56
Finally!




Mouse to move the camera. Mousewheel to zoom.


[Edit]

Screenie:


"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Aralox
17
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 26th Sep 2007 03:25
Nice, i modded it abit so you could generate a new planet at the shift button, but i lost the code

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Sep 2007 19:28
Looks cool
I only have DBC so can you explain what it is doing?
Is it just making a random texture or actually terraforming the planet too?
How would you use this in a game?

In programming, nothing exists
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th Sep 2007 21:31
The idea is relatively simple.

You have a sphere, and you get a random normal. If you had an imaginary plane in the center of the sphere facing that normal, you would move all vertices from one side of the plane away from the center of the planet, and the veritces on the other towards the center.

Do that a few hundred times, and you get a really nice landscape.

I didnt actually think of any way to use this in a game, but now that you mention it, I guess I could use it to make a 3D version of my Luner Lander that worked with circular planets. Maybe a Solar System explorer. Lots of things. That's the great thing about procedurally generated stuff - you have alot of flexibility with it

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Sep 2007 19:29
sounds awesome
how long does it take?

In programming, nothing exists
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2007 22:15
If you mean to generate, then it basically depends on the number of itterations. 100 takes a few seconds for me. 500 takes maybe 20-30 seconds, 1000 takes perhaps a minute.. maybe a little less.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers

Login to post a reply

Server time is: 2024-11-22 13:12:47
Your offset time is: 2024-11-22 13:12:47