Project 07 – JamesKatungyi

Project 07 – Composition with curves

jkatungy-project07-curves

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-07



var n = 27;
var h = 24;
var a = 120;
var Rad = 500;
var t = 0;

//undulating ground
function Topo(){
    fill(200, 100, 0);
    beginShape();
    vertex(width, height - 60); //first vertex on right canvas edge
    for (var i = 0; i < 100; i++){
        t = map(i, 0, 100, 0, PI);
        var x = 300 + cos (t) * Rad;
        var y = sin (t) * Rad - 200;
        vertex(x,y); //vertices defined by curve
        //println(t);
        //println(i);
    }
    vertex(0, height - 60); //vertex on left canvas edge
    vertex(0, height); // lower left vertex
    vertex(width, height); // lower right vertex
    endShape(CLOSE)
    //println(t);
    //println(i);
}
function Hypocycloid(){
    var b = a / n;
    fill(250, 240, 240); //pink
    beginShape();
    for (var i = 0; i < 4000; i++){
        var t = map(i, 0, 4000, 0, TWO_PI*n);
        var x = (a - b) * cos (t) + h * cos ((a - b) * t / b);
        var y = (a - b) * sin (t) - h * sin ((a - b) * t / b);
        vertex(x, y);
    }
    endShape(CLOSE);
}

function setup(){
    createCanvas(600, 400);
}
function draw(){
    background(200, 225, 250);//blue background
    Topo();//undulating ground function
    //mouseX as for canvas translation position
    var locX = map(mouseX, 0, width, 120, 480);
    //relate y value to x along the circle
    var y = sqrt((Rad * Rad) - (locX - 300) * (locX - 300)) - 200;
    //Angle R for canvas rotation as function of mouseX
    var AngleR = map(mouseX, 0, width, 0, PI);
    push();
    //translate canvas to mouseX position and topo y position
    translate (locX, y - 140);
    //rotate canvas relative to mouseX position
    rotate(AngleR);
    //call wheel - hypocycloid
    Hypocycloid();
    pop();
}

Using a hypocycloid, I made a wheel that rolls across the screen following the mouse but along a path defined by an arc. Working out the control parameters to follow the curved path proved difficult but was eventually resolved using the formula for cartesian coordinates of the points of the circle.

Looking outwards – 07 – JamesKatungyi

Artist: Moebio Labs

Title: Ross Spiral Curriculum

Year: 2015

Santiago Ortiz’s Moebio Labs developed an interactive data visualization tool for the Ross Institute Curriculum. The tool is a spiral that connects nodes at each stage of the curriculum. Each node contains information about a particular unit in each grade. Further, the units are interconnected across the grades. When one node is selected, it shows the details while the user is flown up and down the spiral to all other related units in the entire curriculum. All 12 grades are creatively captured in one form. I thought the search function would be important to such a tool but could not identify it.

The algorithms are not given – understandably – since it is a commercial venture. The spiral and accompanying ‘spiralets’ are a function of curve equations. I could not figure out how the 3 dimensional interaction works. I imagine that the graphic forms contain links to both the text and the other graphic forms.

The Ross Spiral Curriculum showcases Santiago Ortiz’s work in representing information across time creatively and interactively. Other projects in the works include a presentation of major historical events recorded by Wikipedia.

James Katungyi – Project 06 – Abstract Clock

Abstract Clock

jameskatungyi-project06-abstractclock

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-06

function setup(){
    createCanvas(300,300);
    
}
function draw(){
    background(227,218,186);
    stroke(208,169,97);
    strokeWeight(1);
    HourBar();//hour bar function
    MinuteLine();//minute line function
    SecondBall();//second ball function
}
function HourBar(){
    var BarH = height/24;
    var H = hour(); //link to computer clock hour
    var M = minute();//link to computer clock minutes
    var HBarX = map(M,0,59,0,width);//link x position to minute
    var HBarY = map(H,0,23,0,height);//link Y position to hour
    stroke(208,169,97);
    if ((HBarY > height*6/24) & (HBarY < height*18/24)){//fill color bar with light color from 6am to 6pm 
        fill(245);
    } else {
        fill(180);//otherwise make hour bar dark
    }
    rect(0,HBarY,HBarX,BarH);//hour bar
    for (var y = 0; y < HBarY; y += 12.5){
        if ((y > height*6/24) & (y < height*18/24)){//fill bars with light shade from 6am to 6pm 
            fill(245);
        } else {
            fill(180);
        }
        rect(0,y,width-1,BarH);
    }  
}
function MinuteLine(){
    var M = minute();//computer clock minute
    var S = second(); //computer clock seconds
    var LineY = map(S,0,59,0,height);//link x position to seconds
    var LineX = map(M,0,59,0,width);//link x position to minutes
    stroke(208,169,97);
    strokeWeight(1);
    line(LineX,0,LineX,LineY);//minute line
    for (var x = 0; x < LineX; x += 5){
        line(x, 0, x, height);
    }
}
function SecondBall(){
    var diam = 20;
    var S = second();//computer clock seconds
    var M = minute();
    var BallX = map(S, 0, 59, 0, width); //link seconds to x position of the ball
    var BallY = map(M, 0, 59, 0, height); //link ball position of y to minutes
    stroke(208,169,97);
    strokeWeight(1);
    if ((BallY > height*7/24) & (BallY < height*19/24)){//fill ball with dark shade from 6am to 6pm 
            fill(180);
        } else {
            fill(245);
        }
    ellipseMode(CENTER);
    ellipse(BallX,BallY,diam,diam); //draw ball
}


As the hours and minutes build up, the canvas fills with boxes and lines. Each day is a fresh start on a clean slate. Each hour starts out less clattered than towards its close.

The seconds are marked by a ball which was supposed to bounce off the sides evoking the ‘tick-tock’ associated with clocks. However, the reverse direction did not work out. In a way, the single direction is better because each second is fresh, not recycled.

The hours relate to the minutes in that one can tell the hour and minute by just looking at the hour indicator. The same with the minutes and seconds. And ofcourse one can tell the night hours from the day hours – a feature that is perhaps only useful in casinos where one never sees the sky.

Project 06 – Abstract Clock

Abstract Clock

jameskatungyi-project06-abstractclock

As the hours and minutes build up, the canvas fills with boxes and lines. Each day is a fresh start on a clean slate. Each hour starts out less clattered than towards its close.

 

The seconds are marked by a ball which was supposed to bounce off the sides evoking the ‘tick-tock’ associated with clocks. However, the reverse direction did not work out. In a way, the single direction is better because each second is fresh, not recycled.

 

The hours relate to the minutes in that one can tell the hour and minute by just looking at the hour indicator. The same with the minutes and seconds. And ofcourse one can tell the night hours from the day hours – a feature that is perhaps only useful in casinos where one never sees the sky.

James Katungyi – Project 06 – Abstract Clock

jameskatungyi-project06-abstractclock

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-06

function setup(){
    createCanvas(300,300);
    
}
function draw(){
    background(227,218,186);
    stroke(208,169,97);
    strokeWeight(1);
    HourBar();//hour bar function
    MinuteLine();//minute line function
    SecondBall();//second ball function
}
function HourBar(){
    var BarH = height/24;
    var H = hour(); //link to computer clock hour
    var M = minute();//link to computer clock minutes
    var HBarX = map(M,0,59,0,width);//link x position to minute
    var HBarY = map(H,0,23,0,height);//link Y position to hour
    stroke(208,169,97);
    if ((HBarY > height*6/24) & (HBarY < height*18/24)){//fill color bar with light color from 6am to 6pm 
        fill(245);
    } else {
        fill(180);//otherwise make hour bar dark
    }
    rect(0,HBarY,HBarX,BarH);//hour bar
    for (var y=0; y < hBarY; y+=12.5){
        if ((y > height*6/24) & (y < height*18/24)){//fill bars with light shade from 6am to 6pm 
            fill(245);
        } else {
            fill(180);
        }
        rect(0,y,width-1,BarH);
    }  
}
function MinuteLine(){
    var M = minute();//computer clock minute
    var S = second(); //computer clock seconds
    var LineY = map(S,0,59,0,height);//link x position to seconds
    var LineX = map(M,0,59,0,width);//link x position to minutes
    stroke(208,169,97);
    strokeWeight(1);
    line(LineX,0,LineX,LineY);//minute line
    for (var x=0; x < LineX; x+=5){
        line(x,0,x,height);
    }
}
function SecondBall(){
    var diam = 20;
    var S = second();//computer clock seconds
    var M = minute();
    var BallX = map(S,0,59,0,width); //link seconds to x position of the ball
    var BallY = map(M,0,59,0,height); //link ball position of y to minutes
    stroke(208,169,97);
    strokeWeight(1);
    if ((BallY > height*7/24) & (BallY < height*19/24)){//fill ball with dark shade from 6am to 6pm 
            fill(180);
        } else {
            fill(245);
        }
    ellipseMode(CENTER);
    ellipse(BallX,BallY,diam,diam); //draw ball
}


As the hours and minutes build up, the canvas fills with boxes and lines. Each day is a fresh start on a clean slate. Each hour starts out less clattered than towards its close.

The seconds are marked by a ball which was supposed to bounce off the sides evoking the ‘tick-tock’ associated with clocks. However, the reverse direction did not work out. In a way, the single direction is better because each second is fresh, not recycled.

The hours relate to the minutes in that one can tell the hour and minute by just looking at the hour indicator. The same with the minutes and seconds. And ofcourse one can tell the night hours from the day hours – a feature that is perhaps only useful in casinos where one never sees the sky.

LookingOutwords-06

Artist: Memo Akten

Title: My secret heart

Year: 2008

Excerpts from My Secret Heart

My Secret Heart is a blend of restricted randomness that organically animates a set of flowing ribbons. It was a part of a music and film performance by Streetwise Opera – a charity that uses music to help homeless people. It is an impressive rendering that resembles flocking behaviour but also evokes a wandering spirit drawn by random attractions.

Memo Akten explains that the ribbons have random attractors at random intervals. Stronger attractors result in flocking. In this case, the mouse was used as a ‘very strong attractor’. Perlin noise was also used in the movement of the ribbon head to its target and in the sway of the other parts of the ribbon. I imagine that it was used to keep the movements from being erratic.

The resulting animation is random but organic akin to a sea creature with tentacles. The movement is random but fluid. It blends seemlessly into the Streetwise Opera performer.

My Secret Heart demo – testing flocking

Project 05-Wall Paper

jkatungyproject05wallpaper

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-05
var x = 400;
var y = 400;

function setup(){
  createCanvas(800,800);
  background(227,218,186);
}
function draw(){
  for(x=100;x<width;x+=200){//loop pattern along x axis
    for(y=100;y<height;y+=200){//loop pattern along y axis
      //stroke(208,169,97);
      //strokeWeight(6);
      //ellipse(x,y,76,76);
      middleFlower(x,y);
      angularScroll(x,y);
      circularScroll(x,y);
    }
  }
  noLoop();
}
function middleFlower(x,y){
  stroke(208,169,97);
  strokeWeight(1);
  ellipseMode(CENTER);
  noFill();
  ellipse(x,y,8,8);
  push();
  translate(x,y);
  for (i=0;i<360;i+=90){//rotate elements 4 times around x,y
    rotate(radians(90));
    ellipse(18,0,19,8);//side ellipse
    arc(19,-19,24,24,radians(45),radians(215));//big arc
    arc(36,-9,18,18,radians(90),radians(180));//small arc 1
    arc(36,+9,18,18,radians(180),radians(270)); //small arc 2
  }
  pop();
  push();
  translate(x+100,y+100);
  for (i=0;i<360;i+=90){//rotate elements 4 times around x,y
    rotate(radians(90));
    ellipse(18,0,19,8);//side ellipse
    arc(19,-19,24,24,radians(45),radians(215));//big arc
    arc(36,-9,18,18,radians(90),radians(180));//small arc 1
    arc(36,+9,18,18,radians(180),radians(270)); //small arc 2
  }
  pop();
}
function angularScroll(x,y){
  stroke(208,169,97);
  strokeWeight(1);
  ellipseMode(CENTER);
  push();
  translate(x,y);
  for (i=0;i<360;i+=90){//rotate elements 4 times around x,y
    rotate(radians(i));
    arc(20,96,250,250,radians(273),radians(306));//innermost lower arc
    arc(28,87,250,250,radians(273),radians(288));//next to innermost lower arc
    arc(186,-72,250,250,radians(161),radians(176));//next to outermost lower arc
    arc(194,-78,250,250,radians(144),radians(177));//outermost lower arc
    arc(-97,-20,250,250,radians(333),radians(356));//innermost upper arc
    arc(-90,-25,250,250,radians(343),radians(354));//next to innermost upper arc
    arc(62,-181,250,250,radians(93),radians(105));//middle upper arc
    arc(70,-188,250,250,radians(94),radians(116));//next to outermost upper arc
    arc(77,-196,250,250,radians(94),radians(126));//outermost upper arc
    println("angular scroll");
  }
  pop();
}
function circularScroll(x,y){
  stroke(208,169,97);
  strokeWeight(1);
  noFill();
  push();
  translate(x,y);
  for (i=0;i<360;i+=90){
    rotate(radians(i));
    ellipseMode(CENTER);
    ellipse(100,0,6,6);//small end ellipse
    arc(100,-3,12,12,HALF_PI,PI+HALF_PI);//small arc around ellipse
    arc(100,0,18,18,PI+HALF_PI,HALF_PI);//big arc around ellipse
  }
  pop();
}

The inspiration was ‘Provincetown Geometric” pattern by Warner Company. My rendition of pattern grows around a unit made up of three fundamental components – the ‘middle flower’, the ‘4 angular scrolls’ and ‘4 circular scrolls’. Each component was built around a polar loop of arcs and ellipses.

To achieve the proportions, I drew it out using CAD software and measured off the parameters by arc and by ellipse (‘patterns’ below). The colors are true to the original. I would not make a shirt out of it, but as wall paper, it would be okay.

patterns

James Katungyi – Looking outwards 05

transport_iv

Artist: Eric J. Heller

Title: Transport IV

Year: undated

A branching shrub-like image results from mapping the 2 dimensional path of each of 100,000 electrons released at a single source, using algorithms. While each electron’s launch angle is different, the paths overlap which increases pixel concentration resulting 3 dimensional texture and depth to the image. The electron paths are mapped in a colour of choice – green in this case.

Of interest to me is how mapping these random trajectories results in an uncanny resemblance to plant ‘geometry’.

In addition to being an artistic piece of work, the idea of recreating the flow of discrete particles to resemble natural organisms, promises to inspire design. Rather than copying by observing, artists – from painters to building designers – can recreate natural patterns using this technique.

The artist, Eric Heller, has produced similar works in the Transport series, all inspired by a team of Harvard scientists that measured electron trajectories.

Similar work – Banyan (below)

banyan

James Katungyi-LookingOutwards-04

Artist: Jono Brandel

Title: Carolina-Experimental musical landscape for Kimbra

Year: 2015

Carolina is an Android application that maps a soundtrack to the changing landscape as one drives through. It plays to artist Kimbra’s ‘road to Carolina’. The camera’s movement is mapped to a spline. Figures pop up as 2D abstractions of the landscapes and fly by just like landscape features. The figures are triggered by instruments in the music track. The combination of simple 2D forms triggered by a soundtrack and moving in a 3D space is a rich piece of work.

The application uses a combination of Two.js for the landscape abstractions and Three.js as the movement of the camera along the spline. The 2D-3D interaction is evident in the application. The various music instruments are represented by specific shapes which in turn trigger the ‘landscape features’ in the camera view, thereby linking each musical instruments to a distinct 2D landscape feature.

The final form is an animated journey through a landscape whose features appear in consonance with the soundtrack. It is a synthesis of music and art in a digital platform just as the artist sought to do.

James Katungyi-Project 04

6 petal flower

james-stringart

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-04

//variables for first set of lines for 6 different petals
//first point x&y values are the same for all 6 petals
var x1=y1=x11=y11=x21=y21=x31=y31=x41=y41=x51=y51=0;
//second point x values are the same for all 6 petals
var x2=x12=x22=x32=x42=x52=180;
//second point y values are the same for all 6 petals
var y2=y12=y22=y32=y42=y52=54;
//variables for second set of lines
//first point x&y values are the same for all 6 petals
var x3=y3=x13=y13=x23=y23=x33=y33=x43=y43=x53=y53=0;
//second point x values are the same for all 6 petals
var x4=x14=x24=x34=x44=x54=54;
//second point y values are the same for all 6 petals
var y4=y14=y24=y34=y44=y54=180;
//spacing
var spacing=18;

function setup() {
  createCanvas(480, 640);
  background(0);
  strokeWeight(1);
  r = color(255,0,0);
  g = color(0,255,0);
  b = color(0,0,255);
  rg = lerpColor(r,g,0.5);
  gb = lerpColor(g,b,0.5);
  br = lerpColor(b,r,0.5);
  push();
  translate(width/2,height/2);//locate lower tip of petal in canvas center
  //first petal
  rotate(radians(45));
  stroke(r);
  for (i=0;i<8;i++){
    line(x1,y1,x2,y2);//set of lines defines first half of petal
    x1=x1+spacing;
    y2=y2+spacing;
    line(x3,y3,x4,y4);//second set of lines defines second half of petal
    y3=y3+spacing;
    x4=x4+spacing;
    line(0,0,180,180);//middle line
  }
  //second petal
  rotate(radians(60));
  stroke(rg);
  for (i=0;i<8;i++){
    line(x11,y11,x12,y12);//first half of petal
    x11=x11+spacing;
    y12=y12+spacing;
    line(x13,y13,x14,y14);//second half of petal
    y13=y13+spacing;
    x14=x14+spacing;
    line(0,0,180,180);//middle line
  }
  //third petal
  rotate(radians(60));
  stroke(g);
  for (i=0;i<8;i++){
    line(x21,y21,x22,y22);//first half of petal
    x21=x21+spacing;
    y22=y22+spacing;
    line(x23,y23,x24,y24);//second half of petal
    y23=y23+spacing;
    x24=x24+spacing;
    line(0,0,180,180);//middle line
  }
  //fourth petal
  rotate(radians(60));
  stroke(gb);
  for (i=0;i<8;i++){
    line(x31,y31,x32,y32);//first half of petal
    x31=x31+spacing;
    y32=y32+spacing;
    line(x33,y33,x34,y34);//second half of petal
    y33=y33+spacing;
    x34=x34+spacing;
    line(0,0,180,180);//middle line
  }
  //fifth petal
  rotate(radians(60));
  stroke(b);
  for (i=0;i<8;i++){
    line(x41,y41,x42,y42);//first half of petal
    x41=x41+spacing;
    y42=y42+spacing;
    line(x43,y43,x44,y44);//second half of petal
    y43=y43+spacing;
    x44=x44+spacing;
    line(0,0,180,180);//middle line
  }
  //sixth petal
  rotate(radians(60));
  stroke(br);
  for (i=0;i<8;i++){
    line(x51,y51,x52,y52);//first half of petal
    x51=x51+spacing;
    y52=y52+spacing;
    line(x53,y53,x54,y54);//second half of petal
    y53=y53+spacing;
    x54=x54+spacing;
    line(0,0,180,180);//middle line
  }
  pop();
}

A 6 petal flower recreated from online string art patterns.stringartdiy