Skip to main content
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Source Link

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

EDIT: Here is a picture I made for illustration:

terraingen

This is the same idea!This is the same idea!

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

EDIT: Here is a picture I made for illustration:

terraingen

This is the same idea!

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

EDIT: Here is a picture I made for illustration:

terraingen

This is the same idea!

Added picture; added 143 characters in body
Source Link

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

EDIT: Here is a picture I made for illustration:

terraingen

This is the same idea!

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with (ranged) random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!

EDIT: Here is a picture I made for illustration:

terraingen

This is the same idea!

Source Link

One way you could achieve this the following:

  • Create a point in the middle of the screen, with a random height; you now have two sections, one on each side of this point
  • For every section, divide into two placing a point in the middle of this section, with random height between its two neighbours
  • Repeat n times.

What happens is detail in the scenery gets finer with each iteration.

How you handle boundary cases is up to you: you could assume points at (0,height/2) and (width,height/2) for instance.

Hope this helps!