We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Bear with me guys :) am very new to this.
Could you point out what's the problem/s here? can't really figure out why this is not running.
thank you!
var i, x, w = 70,
h = 500,
y, s = 10;
var k, m, r, j = .008,
n;
function setup() {
createCanvas(700, 600, WEBGL);
noStroke();
}
function draw() {
background(190, 181, 175);
beginShape(9);
stroke(255, 102, 75);
noFill();
for (i = 0; i < w * h; i += s) {
x = i % w;
y = i / w;
k = y + s;
m = x + s;
vertex(x, n(y * w + x), y);
vertex(m, n(y * w + m), y);
vertex(m, n(k * w + m), k);
vertex(m, n(k * w + m), k);
vertex(x, n(k * w + x), k);
vertex(x, n(y * w + x), y);
i += i % w == 0 ? w * (s - 1) : 0;
}
endShape();
r -= j;
}
function n(i) {
return noise(i % w * j, i * j / w + r) * s * 10 + h / 2;
}
Answers
this version runs in standard JAVA processing
@Roupen: go to hello.p5js.org and confirm your PC/browser supports WebGL. The old laptop I'm using here doesn't, and I see a message to that effect on the above site...
thank you @Chrisir. It doesn't really solve my problem :)
@blindfish: I have tried other examples that use that use WebGL, and they work.
still struggling with this >>>
@Roupen: looks like there are some significant discrepancies between p5js and Processing. This is getting some of the way there; but the triangles don't appear to line up properly at present: