Showing posts with label Scripting. Show all posts
Showing posts with label Scripting. Show all posts

Monday, January 4, 2010

Arduino code for four lasers

This is some of the code I am working on for the MFA project that I mentioned in the last post. Right now I simply have four photocells, each controlling an LED. Next week I plan to get one of these so that I can replace the lights with a triggered sound. This might require significant reworking of the code... we'll see.

First the video, then the code:



/*
Created 11 Dec 2009
By J Howell
modified 14 Dec 2009

*/

int ledPinA = 10; // LED connected to digital pin 10
int ledPinB = 11; // LED connected to digital pin 11
int ledPinC = 6; // LED connected to digital pin 11
int ledPinD = 5; // LED connected to digital pin 11
int val0; // define variable for photoresistor 0
int val1; // define variable for photoresistor 1
int val2; // define variable for photoresistor 1
int val3; // define variable for photoresistor 1
int ledBrightness; //


void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}

void loop()
{
val0 = analogRead(0); // read analog input pin 0
val1 = analogRead(1); // read analog input pin 1
val2 = analogRead(2); // read analog input pin 2
val3 = analogRead(3); // read analog input pin 3

if( val0 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinA, -(fadeValue0));
}
}
else{
digitalWrite(ledPinA, LOW);
delay(10);
}
if( val1 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinB, -(fadeValue0));
}
}
else{
digitalWrite(ledPinB, LOW);
delay(10);
}

if( val2 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue1 = 0 ; fadeValue1 <= 255; fadeValue1 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinC, -(fadeValue1));
}
}
else{
digitalWrite(ledPinC, LOW);
delay(10);
}
if( val3 < 400){
// fade in from min to max in increments of 1 points:
for(int fadeValue0 = 0 ; fadeValue0 <= 255; fadeValue0 +=1) {
// sets the value (range from 0 to 255):
analogWrite(ledPinD, -(fadeValue0));
}
}
else{
digitalWrite(ledPinD, LOW);
}
}

Saturday, December 19, 2009

Some recent work

I have been extremely negligent about publishing posts. Its nearing the end of 2009 and I'll go ahead and make my first new years resolution right now: I am going to try to update this blog at least twice per month.
There is actually quite a lot going on for me right now. I recently completed two sculpture projects for Cliff Garten Studio, the first a bench/sculpture at the new Sacramento Valley High School Library and the other is a collection of small columns in front of the Academy of Art University in North Hollywood. Both pieces use a simple array of stainless steel rods bent into the same profile and welded together at connection points. It is a very simple design which work well for these low budget projects, but I am pretty pleased with how they look when lit up at night. The Sacramento photos were taken by my friend Linda Dang.




I am also working with my friend Liz Terschurr on the design and electronics for the set of a dance performance this coming February at UCLA. The stage will be crisscrossed with visible laser beams that control sound effects. The dancers are choreographed to interrupt the beams at key moments and create a real-time background score for the performance. Essentially this is a larger version of this laser harp but the beams will actually cross parts of the stage rather than being confined to a small area. I will post some videos and the code I am working on shortly. As always comments and suggestions are appreciated since I am a bit rough in my knowledge of writing code.

Tuesday, May 27, 2008

Hernesaari Urban Plan: Tower core and surface articulation

As a programmatic strategy, we have been working towards creating a "vertical urbanism" within the towers. This idea obviously ties back to several previous posts about the vertical urbanism of Tokyo, yet in this situation we are dealing with a new development in a significantly lower density urban milieu. However, Helsinki already has an interesting mixed use typology already in place, which we are closely trying to follow. There are many vertical and underground shopping centers which are very different from developments you would see in the US. There are also several successful instances of restuarants and bars being located on the top of residential and office towers, which is an example of time based use as a device to increase the vibrancy of singular buildings. This was a large part of the thesis for my Little Tokyo project from last Winter Quarter.

In the programming of the towers, we have developed ratios of residential, office, entertainment, retail, essential commericial and hotel which are applied to each tower individually based on contextual information, parking, transportation infrastructure, views and proximety to boat berths. For example, the two largest towers are located at the entrance to the development, with the best access to public transportation (tram and bus) as well as close proximety to the bridge connecting Hernesaari with the new development being planned for the peninsula directly West. These towers at 20 stories also have the best views of the city, ocean and marina, as well as being a logical transition between the city of Helsinki proper and the new cruise ship terminal on our site. Because of these factors we have given the towers a ratio of 40% high end residential, 30% office, and 30% recreational shopping.



For the articulation of these program mixtures, we've scripted a process which offsets the tower surface to create an inner skin. This offset distance varies depending on the program mixture. The residential spaces receive a low offset, so that they sit very close to the outer surface, while entertainment and commercial spaces get offset farther inwards, creating a situation where the public programs sit within the poche space of the wall section. As a happy, but unintended side effect of the script, this also tends to create "bleb" spaces... to borrow a term from Greg Lynn. These blebs topologically follow the surface direction and curvature, but also as applied ornament.





The script is posted below:

/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------

OFFSET POLYGONAL SURFACE BASED ON PROXIMITY TO LOCATORS

begin by manually locating locators in space to define offset amount. polygons will offset linearly from locator through distance
defined by variable "offsetDist". first select object for offset prior to running the script. can use a maximum of 3 locators.

script written by Joshua Howell
UCLA Spring 2008, Kivi Sotamaa studio

Status: 05-25-2008: working!


*/

$cvCount = polyEvaluate -v;


$list = `ls-sl`; //define variables
$object = $list[0]; //define object for offset

int $offsetDist = 3;
rename "object";
xform -cp;


vector $ptLocatorA = `pointPosition -w ("locator1")`;
vector $ptLocatorB = `pointPosition -w ("locator2")`;
vector $ptLocatorC = `pointPosition -w ("locator3")`;

for ($i = 0; $i<= $cvCount; $i++) { vector $ptObject = `pointPosition -w ("object" + ".vtx[" + $i + "]")`; float $aa = (($ptLocatorA.x) - ($ptObject.x)); float $ba = (($ptLocatorA.y) - ($ptObject.y)); float $ca = (($ptLocatorA.z) - ($ptObject.z)); float $ab = (($ptLocatorB.x) - ($ptObject.x)); float $bb = (($ptLocatorB.y) - ($ptObject.y)); float $cb = (($ptLocatorB.z) - ($ptObject.z)); float $ac = (($ptLocatorC.x) - ($ptObject.x)); float $bc = (($ptLocatorC.y) - ($ptObject.y)); float $cc = (($ptLocatorC.z) - ($ptObject.z)); float $da = sqrt(((($aa*$aa) + ($ba*$ba) + ($ca*$ca)))); float $db = sqrt(((($ab*$ab) + ($bb*$bb) + ($cb*$cb)))); float $dc = sqrt(((($ac*$ac) + ($bc*$bc) + ($cc*$cc)))); select ("object" + ".vtx[" + $i + "]"); if (($da<$db) && ($da<$dc) && (($offsetDist-$da)>0))

moveVertexAlongDirection -n (-($offsetDist-$da));

else

if (($db<$da) && ($db<$dc) && (($offsetDist-$db)>0))

moveVertexAlongDirection -n (-($offsetDist-$db));

else

if (($dc<$db) && ($dc<$da) && (($offsetDist-$dc)>0))

moveVertexAlongDirection -n (-($offsetDist-$dc));

else
moveVertexAlongDirection -n (-0.5); //move faces too far away from locators 1/2 meter in from outer surface

}

Tuesday, May 13, 2008

Helsinki Hernesaari Yacht Club and Marina

Mid review model photos from Kivi Sotamaa's research studio, "Spasms Convulsions Eruptions: New Sensations of Movement".












Monday, January 7, 2008

Winter Lineup

First day of classes were today, and it looks like another hard hitting line up. For studio I have Hitoshi Abe and we will be travelling to Tokyo for ten days at the end of January/early February. The research studio with Kivi Sotamaa will also be continuing, but now we will be moving into digital and physical techniques and less research. As electives I will be taking theory with Sylvia Lavin, and possibly a directed study with Marcelyn Gow that will construct a small scale installation involving scripting, and computer controlled interactivity. To top everything off, there will be several short workships/seminars that I am looking forward to. In February there will be a week long design charrette led by several young Japanese architects, as well as an advanced rendering and scripting seminar led by a person from Neil Denari's office. More to come on that later...

Monday, December 31, 2007

chapel in the park

Final presentation boards and renderings from Craig Hodgett's advanced topics studio, Fall 2007. Model photos coming soon...


Wednesday, November 7, 2007

no images...

Its been over a month since I last posted, so I figured it was about time to get something new up. Unlike in previous quarters, it seems I no longer produce much visual work to post. I need to download a java applet so I can post some of the animations I have been doing for programming class. We started dealing with user interaction a few weeks ago and I have created a few simple programs which generate pattern and colors based on mouse movement and clicking.
I've been able to use a similar programming syntax to script part of my studio projects. I've decided to focus in on two simple areas for the time being: brick patterns and a woven screen. The bricks were fairly easy to deal with using a simply flow command to array a primitive (brick) along a surface. The next step I have started to address is rotating the bricks based on surface curvature at a given point. I'm looking to use the brick as more of a screen rather than opaque wall, so as the brick rotates it creates small openings in the surface of the skin.
The screen uses user inputed variables, controlling starting and ending diameter as well as middle diameter in both vertical and horizontal directions. I would like to make the variables in one direction user controlled, and then control the variables in the other direction based on diameter size at the intersection points. I haven't been fully successful with this yet...
I will try to get images posted soon. Review is on Friday, so I am being forced to produce!
In other news... Architecture in Helsinki concert tomorrow night!

Wednesday, October 3, 2007

Fall Lineup

Classes began last Friday. This quarter I am taking Advanced Topics Studio with Craig Hodgetts, Research Studio with Kivi Sotamaa, Computer Programming, a seminar titled "Soft Monstrosities" by Marcelyn Gow, as well as TA'ing for the Introduction to Computers class. I think the lineup this quarter is one of the strongest yet and will allow me to work between a variety of topics and mediums. The research studio and Soft Monstrosities are heavily interested in a contemporary discourse on affect in architecture, and will develop ideas through both written and graphical means. The studio will focus on implied movement in architecture, working with computer animation software, particle fields, generative scripting as well as physical studies of form and material.
The Advanced Topics Studio has developed in a very hands on manner. Our first project, a large scale light study model, is due this coming Friday. Hopefully this contrast between analog and digital approaches to design will prove productive and not frustrating.
Meanwhile, in the Computer Programming class, I will learning how to write parametric design programs. This quarter presents a very broad spectrum of work and I hope to be able to merge these approaches as the year progresses.