bruit de perlin

This commit is contained in:
MOISOIU Stefan-Mihai
2026-02-23 11:29:41 +01:00
parent 3276da46d8
commit 5a884429fa
4 changed files with 170 additions and 8 deletions

View File

@@ -17,15 +17,16 @@ public class Ligne extends ObjetGraphique {
protected double limiteHaut = 50;
protected double limiteBas = 550;
public Ligne() {
public Ligne(NoiseGenerator noiseGenerator) {
double x = 0;
double y = 200;
double dx, dy;
Segment s;
for (int i = 0; i < nbSegments; i++) {
dx = Math.random() * 20 + 80;
dy = Math.random() * 40 - 20;
dx = 10;
dy = noiseGenerator.noise(x / 15) * 8;
if (y + dy > limiteBas) {
dy = limiteBas - y;