Skip to content

Strange disconnect in 2D in -X+Y and +X-Y quadrants #7

@akastormseeker

Description

@akastormseeker

What steps will reproduce the problem?
Generate noise using CalcPixel2D() in all four cartesian quadrants

for(x = -1000; x <= 1000; x++) {
for(y = -1000; y <= 1000; y++) {
map[x,y] = Noise.CalcPixel2D(x, y, 100);
}
}

What is the expected output? What do you see instead?
Expected: smooth gradients between "hills" and "valleys" all across the map
Instead: Two lines, roughly 22.5 degree and 67.5 degree angles, passing through 0,0, from -X/+Y to +X/-Y quadrants

What version of the product are you using? On what operating system?
Master branch, Windows 10

Please provide any additional information below.
I was experimenting with custom Minecraft procedural world generation. The base terrain level function was this:
//----------------------------------
// chunks are 16x16 block sections, that go off to +/- infinity in X and Z directions, 0-255 in Y (height) direction
// get offset to absolute block coordinates
int offsetX = chunk.x * 16, offsetZ = chunk.z * 16;
for(int x = 0; x <= 16; x++) {
for(int z = 0; z <= 16; z++) {
columnHeight = baseHeight + (int)(Noise.CalcPixel2D(offsetX + x, offsetZ + z, 100) * 16);
for(int y = columnHeight; y >= 0; y--) {
chunk.SetBlock(x, y, z, Blocks.Stone);
}
}
}
//----------------------------------
When standing at 0,0 there are two very obvious lines of discontinuity.

Screenshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions