Slide 6
Slide 6 text
function calc(vertices, iterations, a, b, c, d, e, f) {
// variable declarations
// ...
for (var i = 0; i < iterations; i++) {
xNew = x * Math.sin(a * x) + Math.cos(b * y);
yNew = y * Math.sin(c * y) + Math.cos(d * z);
zNew = z * Math.sin(e * z) + Math.cos(f * x);
x = xNew;
y = yNew;
z = zNew;
vertices[i * 3] = x;
vertices[i * 3 + 1] = y;
vertices[i * 3 + 2] = z;
}
}
Code