Linescapes Iteration 9

Sep 07 2011 Published by under Uncategorized

A different gety function:


$(function() {
var canvas, linescape, hills;

canvas = $(“#canvas”).get(0);
linescape = new LineScape(canvas);
linescape.xres = 1;
linescape.zres = 0.5;

hills = [];
for(var i = 0; i < 100; i += 1) { hills[i] = {x:Math.random() * 1000 - 500, z: Math.random() * 2000, force:Math.random() * 2000 + 1000}; } linescape.gety = function(x, z) { var y = 600; for(var i = 0; i < 100; i += 1) { var hill = hills[i]; var dx = hill.x - x; var dz = hill.z - z; var dist = Math.sqrt(dx * dx + dz * dz); y -= Math.sin(1 / dist * 1000) * 10; } return this.ycenter + y; } linescape.draw(); });[/php] Result.

3 responses so far. Comments will be closed after post is one year old.

  • Pear says:

    Convergence between art and technology. I get a feeling of emptiness and sadness when the image comes to live (seen the example as an artwork), I don’t now why, maybe the lines and colors blending with each other, creating some kind of deserted landscape. Well, sorry got little deep there 😉

  • mehdadoo says:

    When will come tomorrow then?

  • Todd says:

    oustanding series, thanks for the posts.