Linescapes Iteration 4

Segmentize and randomize.

[php lang=”JavaScript”]$(function() {
var canvas, context, width, height, x, x1, x2, y, z = 600, fl = 350, xres = 5, zres = 5, xcenter, ycenter, scale;

canvas = $(“#canvas”).get(0);
context = canvas.getContext(“2d”);
width = canvas.width;
height = canvas.height;
xcenter = width / 2;
ycenter = height / 2;

while(z > 0) {
scale = fl / (fl + z);
x1 = xcenter – width / 2 * scale;
x2 = xcenter + width / 2 * scale;
y = ycenter + (200 + Math.random() * 5) * scale;
context.beginPath();
context.moveTo(x1, y);
for(x = x1; x <= x2; x += xres) { y = ycenter + (200 + Math.random() * 5) * scale; context.lineTo(x, y); } context.stroke(); z -= zres; } });[/php] Result.

This entry was posted in JavaScript. Bookmark the permalink.

3 Responses to Linescapes Iteration 4

  1. Looks like a volcanic Egyptian pyramid with the top blown off.
    Or maybe someone’s pubic hair collection taped to a sheet of paper in size order.

  2. chris says:

    Reminds me Joy Division album cover somehow

Leave a Reply