Creating circles???

Discussion in 'Plugin Development' started by Niv-Mizzet, Jan 2, 2020.

Thread Status:
Not open for further replies.
  1. Offline


    I know i just posted on here a few hours ago.

    I'm trying to make an automatic floating island generator.

    Here's how it works:
    The top layer is a circle (which is trimmed a bit later to make it look more random)
    The layer below that is randomly generated with Perlin noise, and the layer below that one is created based on the layer above, and so on and so forth.
    My problem is I don't know the equations to figure out the number of blocks in a circle and what the circle looks like. Can anyone help me?

    Thanks in advance
  2. There are lots of algorithms to rastarize a circle. For example by Horn:

    (r = radius)
    d = −r
    x = r
    y = 0
    repeat until y > x
        Paint pixel (x,y) as well as all the symmetrical ones (all possible combinations of positive and negative x and y's)
        d = d + 2×y + 1
        y = y + 1
        if d > 0
            x = x - 1
            d = d - 2×x
    (German wikipedia article)
    Might help
  3. For the perlin noise, I would make sure to do some sort of smoothing around the edges, otherwise you'd get blank walls of peaks cut off near the edge of the circle.
Thread Status:
Not open for further replies.

Share This Page