//                            :::::::::  :::::::::: ::::    ::: 
//                          :+:    :+: :+:        :+:+:   :+:  
//                         +:+    +:+ +:+        :+:+:+  +:+   
//                        +#++:++#+  +#++:++#   +#+ +:+ +#+    
//                       +#+        +#+        +#+  +#+#+#     
//                      #+#        #+#        #+#   #+#+#      
//                     ###        ########## ###    ####       

//                                    :::::::  
//                                  :+:   :+:  
//                                  +:+ +:+    
//                                  +#++:  ++# 
//                                +#+ +#+#+#   
//                              #+#   #+#+     
//                              ##########     


////////////////////////////////////////////////////////////////////////////////
///////////// Interview with Shawn Brauch of Pen & Pixel Graphics //////////////
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////

// A: How did the company start? 
//  S: My brother and I were working for Rap-A-Lot Records in Houston, Texas. 
//    My brother was general manager of the label from the start, he had worked 
//    there for a number of years. Other than 2 Live Crew, Rap-A-Lot was was the 
//    first exposure that America had basically seen to gangsta style southern 
//    rap. I came to Rap-A-Lot in about 1991 to assist him directing music 
//    videos. My main purpose was story-boarding. My brother was more into 
//    business, I was more into graphics. Before that, I went to the Chicago 
//    Art Institute, I have one degree there and another one in Parsons School 
//    of Design in graphic communication.
//
//   A: What albums did you work on, over at Rap-A-Lot?
//   S: Quite a few. One of the first albums was Prince Johnny C, and most of the 
//    Geto Boys albums.
//
//   A: Why did you choose to leave Rap-A-Lot and run your own business?  
// S: We had started using computer special effects on some of the album covers 
//    of that time. Willie D's "I'm Going out like a soldier" was actually the 
//    first CD cover to use a high amount of photorealistic special effects. 
//    When that album came out, people started saying that they wanted that for 
//    their covers. So they would come to Rap-A-Lot, thinking that they would 
//    just get the artwork and nothing else, but Rap-A-Lot obviously said that 
//    was impossible. The demands for the work went up to the point where my 
//    brother and I said "Listen, that sounds like a good business venture, so 
//    let's start and do our own thing".  
//
// A: Was it an easy move at the time?  
// S: Yeah, we started out with $1K to buy computer equipment to seed the 
//    company. We worked out of our apartment, on the dining room table.
//
//   A : Both of you were hip-hop fans?  
// S : Oh, well, yeah. I mean, yeah, you could say that. It kinda grew on us but 
//     that the demand for the work was there, and we said "Well, let's supply 
//     the service" as the demand gradually grew. That was really a business-
//     oriented move.  
//
// A: Both of you grew up in Houston?
//   S: No, we actually grew up overseas. We lived in south-east Asia and Brazil 
//    most of our lives. I got in Houston in 1991 and left in 2003. My brother 
//    was there from 1989 all the way until, well, he just left recently.
//
//   A: So, as soon as you arrived in Houston, it was on, you were in the music 
//    business.
//   S: Yeah, instantly. The day I arrived, I went to a movie set and I started 
//    working on music videos.
//
//   A: What was your philosophy for Pen & Pixel?  
// S: Well, at the very, very beginning, I noticed that people had not really 
//    got a good understanding of Photoshop and what you could do with it. 
//    People were paying a huge amount of money to go and have themselves in 
//    front of a Bentley, and hire models, and rent jewelry, and go to a 
//    location… I also had a background in photography, and before Pen & Pixel, 
//    your photoshoot could be $15-20k just to get everything right. And there 
//    were still not the dimension, the bling-bling, that was limited on what 
//    you can do with it. So what I said is "Why do all that when we can actu-
//    ally do that at one-tenth of the price? We have everything: we have pic-
//    tures of Rolls Royces, pictures of girls, pictures of diamonds, we have 
//    all this stuff, including their clothes!" If they didn't want to buy 
//    clothes, all we can do is photograph the face, and we will have a body 
//    model, mimick up their bodies and we would put it in a place where you 
//    would never know the difference. And it worked. That formula worked very 
//    very well.
//
//   A: How did you get all those photos? You were making separate photo shoots?  
// S: Absolutely. For example, if we had the chance to rent a Rolls Royce or 
//    go down to the Bentley dealership, we would shoot 250 pictures at one 
//    time, with no one on it, no one inside it. We would take that back to Pen 
//    and Pixel and cut it out very meticulously inside and outside, knowing 
//    that we would shoot a model and put that model in the Bentley driving it 
//    down the freeway. We knew exactly what the lighting situation was, we took 
//    all these notes on how everything was done. So when we shot the model or 
//    the rapper in the studio, the lighting and everything fell together 
//    absolutely perfectly.

////////////////////////////////////////////////////////////////////////////////

color backgroundColor;
color foregroundColor;
color foregroundColor2;

float px, py;
float pfx, pfy;
float pv2, pvx, pvy;
float pa2, pax, pay;
float pMass, pDrag;

void setup() {
  size(640, 360, P3D);
  noStroke();
  backgroundColor = color(0, 0, 0);
  foregroundColor = color(255, 255, 255);
  foregroundColor2 = color(170, 170, 170);
  initParticle(0.6, 0.9,  width/2, height/2);
}

void draw() {
  background(backgroundColor);
  pushMatrix();

  iterateParticle(0.15*(-px+mouseX), 0.15*(-py+(height-mouseY)));

  translate(width/2, height/2, 0);
  fill(foregroundColor);
  drawK();
 
  pushMatrix();
  translate(0, 0, 1);
  translate(0.75 * (px-width/2), -0.75 * (py-height/2), 0);
  translate(0.75 * (px-width/2), -0.75 * (py-height/2), 0);
  rotateZ(atan2(-(py-height/2), (px-width/2)) + PI/2);
  rotateX(PI);
  rotateZ(-(atan2(-(py-height/2), (px-width/2)) + PI/2));
  
  fill(foregroundColor2);
  drawK();
  popMatrix();

  translate(0.75 * (px-width/2), -0.75 * (py-height/2), 2);
  rotateZ(atan2(-(py-height/2), (px-width/2)) + PI/2);
  
  fill(backgroundColor);
  beginShape(QUADS);
  vertex(-640, 0);
  vertex( 640, 0);
  vertex( 640, -360);
  vertex(-640, -360);
  endShape();
  
  popMatrix();
 
}

void initParticle(float _mass, float _drag, float ox, float oy) {
  px = ox;
  py = oy;
  pv2 = 0.0;
  pvx = 0.0;
  pvy = 0.0;
  pa2 = 0.0;
  pax = 0.0;
  pay = 0.0;
  pMass = _mass;
  pDrag = _drag;
}

void iterateParticle(float fkx, float fky) {
  pfx = fkx;
  pfy = fky;
  pa2 = pfx*pfx + pfy*pfy;
  if (pa2 < 0.0000001) {
    return;
  }
  pax = pfx/pMass;
  pay = pfy/pMass;
  pvx += pax;
  pvy += pay;
  pv2 = pvx*pvx + pvy*pvy;
  if (pv2 < 0.0000001) {
    return;
  }
  pvx *= (1.0 - pDrag);
  pvy *= (1.0 - pDrag);
  px += pvx;
  py += pvy;
}

void drawK() {
  pushMatrix();
  
  scale(1);
  translate(-230, 70);
  beginShape(QUADS);
  vertex(0, 0, 0);
  vertex(0, -140, 0);
  vertex(38, -140, 0);
  vertex(38, 0, 0);
  
  vertex(38, -140, 0);
  vertex(85, -140, 0);
  vertex(100, -80, 0);
  vertex(38, -45, 0);
  
  vertex(110,0,0);
  vertex(110,-140,0);
  vertex(150,-140,0);
  vertex(150,0,0);
  
  vertex(160,0,0);
  vertex(200,0,0);
  vertex(280,-140,0);
  vertex(240,-140,0);
  
  vertex(160,-140,0);
  vertex(200,-140,0);
  vertex(280,0,0);
  vertex(240,0,0);
  
  vertex(290,0,0);
  vertex(325,0,0);
  vertex(325,-140,0);
  vertex(290,-140,0);
  
  vertex(325,0,0);
  vertex(370,0,0);
  vertex(370,-35,0);
  vertex(325,-35,0);

  vertex(325,-60,0);
  vertex(370,-60,0);
  vertex(370,-90,0);
  vertex(325,-90,0);

  vertex(325,-110,0);
  vertex(370,-110,0);
  vertex(370,-140,0);
  vertex(325,-140,0);

  vertex(380,0,0);
  vertex(415,0,0);
  vertex(415,-140,0);
  vertex(380,-140,0);
  
  vertex(410,0,0);
  vertex(460,0,0);
  vertex(460,-35,0);
  vertex(410,-35,0);

  endShape();
  popMatrix();
}




