# It might not look like much but...

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

## Recommended Posts

Though not very graphically stunning, it took me quite a bit of work to get it the way I wanted it. All the points on the sphere are equidistant (needed for the type of terrain generation I'm trying to do). This will work for any number of points. I'd been fighting with different subdivision techniques that just weren't giving me the results I was looking for. The algorithm that did work was treating all points as if they had gravity and recursively moving points to different locations if that location had less gravity. I'm sure I'm not the first person to think of doing it this way, but my stuff rarely works, so I'm proud of it regardless.

##### Share on other sites
Have you looked at Spherical Code (MathWorld)?

##### Share on other sites
Quote:
 Original post by RaHave you looked at Spherical Code (MathWorld)?

I've looked at several different ways of getting points evenly spaced on a sphere. Unfortunately, most analytical methods limit you to only certain solids that will work (cube, icosahedron, dodecahedron).

At any rate, the planet generator is coming along slowly but surely.
Still not where I'd like it to be, but progress is progress.

I'm not sure yet what's causing the "crater" effect.

##### Share on other sites
I've come across a problem like that. You need to look at your code.

Sorry!

##### Share on other sites
Quote:
 Original post by ChemicalImbalanceThe algorithm that did work was treating all points as if they had gravity and recursively moving points to different locations if that location had less gravity.

That doesn't sound right. For instance, consider the sphere you have right now. Pick the point farthest to the left. Imagine moving that point farther to the left: now it experiences less gravity than the rest of the points (it's farther away from all of them), so your algorithm moves it there. In theory, your algorithm should have caused all the points to accelerate outwards from the sphere's origin at infinite speed.

This may or may not be contributing to the cratering effect you describe. Are the colorations supposed to be altitudes relative to a perfect sphere? If so, it just means your sphere isn't smooth enough relative to a perfect sphere. Pick more points.

##### Share on other sites
Quote:
Original post by kSquared
Quote:
 Original post by ChemicalImbalanceThe algorithm that did work was treating all points as if they had gravity and recursively moving points to different locations if that location had less gravity.

That doesn't sound right. For instance, consider the sphere you have right now. Pick the point farthest to the left. Imagine moving that point farther to the left: now it experiences less gravity than the rest of the points (it's farther away from all of them), so your algorithm moves it there. In theory, your algorithm should have caused all the points to accelerate outwards from the sphere's origin at infinite speed.

This may or may not be contributing to the cratering effect you describe. Are the colorations supposed to be altitudes relative to a perfect sphere? If so, it just means your sphere isn't smooth enough relative to a perfect sphere. Pick more points.

Un less he has specified a radius.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 11
• 29
• 15
• 41
• ### Forum Statistics

• Total Topics
634838
• Total Posts
3019568
×