minkraft
minkraft copied to clipboard
Need Help~ How to use simdnoise::NoiseBuilder::ridge_2d_offset?
Maybe this issue is not about minkrift~~ I just find your world look good with using of imdnoise::NoiseBuilder::ridge_2d_offset
I also use it to build a world but it looks like very ugly. Why? IF any tips on set params?? my core code like this:
let withd = 100;
let (noise, min, max) = simdnoise::NoiseBuilder::ridge_2d_offset(
0.0,
withd,
0.0,
withd,
)
.with_freq(0.025)
.with_octaves(5)
.with_seed(2022)
.generate();
for x in 0..withd {
for z in 0..withd {
info!("[{}],[{}]", x + z, noise[x + z]);
let yy = (5.0 - noise[x + z]) * 512.0 + 128.0;
for y in 0..256 {
let p = Point3D::new(x as i32, y as i32, z as i32);
if (y as f32) < yy {
res.data.insert(p, grass.clone());
}
}
}
}
it any wrong with it ? Please help me thanks.