Member 208
6 entries
20434 views

 RSS
Project moderator:
Emergence and Navigating...
C.E.B. Reas (M)
Los Angeles, US
Immortal since Dec 8, 2007
Uplinks: 0, Generation 1

REAS
  • Affiliated
  •  /  
  • Invited
  •  /  
  • Descended
  • Recently commented on
    From rhymeandreason
    "draw tangent to..." part...
    reas’ project
    Emergence and Navigating...
    Develop a generative, emergent process to fill space (2D or 3D) using only black lines. Modify a known process or invent your own. Implement your...
    Now playing SpaceCollective
    Where forward thinking terrestrials share ideas and information about the state of the species, their planet and the universe, living the lives of science fiction. Introduction
    Featuring Powers of Ten by Charles and Ray Eames, based on an idea by Kees Boeke.
    From reas's personal cargo

    Network Code
    Project: Emergence and Navigating Space
    // This is general, simple code for each element to be "aware"
    // of every other element. Specifically, it draws a line from each
    // node to every other node.


    Node[] nodes;

    void setup() {
    size(600, 600);
    nodes = new Node[6];
    for (int i = 0; i < nodes.length; i++) {
    nodes[i] = new Node(random(width), random(height), 10, nodes, i);
    }
    }

    void draw() {
    for (int i=0; i < nodes.length; i++) {
    nodes[i].connect();
    nodes[i].display();
    }
    }

    class Node {
    float x;
    float y;
    float diameter;
    Node[] otherNodes;
    int id;

    Node (float xin, float yin, float din, Node[] others, int idin) {
    x = xin;
    y = yin;
    diameter = din;
    otherNodes = others;
    id = idin;
    }

    void connect() {
    for (int i=id; i < nodes.length; i++) {
    line(x, y, otherNodes[i].x, otherNodes[i].y);
    }
    }

    void display() {
    ellipse(x, y, diameter, diameter);
    }

    }

    Thu, Jan 17, 2008  Permanent link
    Categories: code
    Sent to project: Emergence and Navigating Space
      RSS for this post
    1 comment
      Promote
      
      Add to favorites
    Create synapse
     
    Comments:


    HackerLastPip     Fri, Jan 25, 2008  Permanent link
    In case anyone was curious about the code Robert used in some of his videos, I found some source code.

    EDIT: a lot more code.
    in particular this and this and this
     
          Cancel