Week 2 : Control Statements

This week I was introduced to control and conditional statements in Chapters 5, 6, and 7 of Learning Processing. This is probably the one part I was least looking forward to, simply because loops and conditionals begin to get a little confusing the moment they start to get nested. But they are really the elements, along with variables, that give programming its procedural nature and help automate a lot of tasks and decisions. A few key functions and system variables were discussed: constrain(), random(), mousePressed(), keyPressed(), height ,and width.

random() is the first function we get familiarized with that returns a value. There are a lot of these in Processing. A few that were not discussed in the book that I found useful for coding my Lesson 2 project were dist(), which measures the distance between two points, and map(), which remaps a value from range to another range.

Random function

Random function

Constrain function

Constrain function at play… Prevents the circle ball from leaving the boundary of the window.

constrain() was introduced as a handy tool for use in simple physics simulation and creating a bouncing ball. Though it would be just as effective to use a conditional to restrain the ball from moving past the edges of the window, constrain() reduces this to a line of code instead of several.

They are pretty self-explanatory and show how well prepared Processing is to making the process of scripting user interactive compositions very straightforward. The notion of local vs. global variables was also emphasized as we started creating local variables to drive our for and if blocks of code. In the context of making conditions that occur when a user presses a key or mouse buttons, the benefit of declaring a global boolean variable was immediately evident as this allows the code to toggle between false or true according to the user actions. A global variable was used in my Lesson 2 Project.

On to Project 2. With the introduction of control loops and if statements, compositions can begin to feel a little more fancy. The author of the book wants you to continue using the first composition from week 1 project but I am opting to start each one from scratch because what was done in a previous week does not necessarily have room for further improvement and it should also allow me more creative freedom.

My goal this week was to create an attractor-based circle pattern. With mouseX and mouseY position data available at my disposal, it would be really cool to see if I could make the cursor an attractor. As Processing allows for interactive compositions, the pattern would be able to change in real-time. I wanted to make the size of the circles vary depending on how close they were from the cursor.

Project 2 Sketch

Project 2 Sketch

The main issue was finding a way to translate distance data between each circle into information that could be used for scaling. Obviously I needed to find a way to make values lie in between 0 and 1 and multiply that scaling factor times the width and height of each circle. I discovered the map() function in the Processing reference page and was delighted to find out that it does exactly what I needed. I can already see a lot of uses for this function.

Next week I will learn how to create my own functions and start talking abt objects. This will be very useful in developing my own particle system. And I hope that I’ll be able to create a basic particle system next week or the following.

Click on this link to interact with my Project 2 composition.

See you next week!

Ted

Week 1 – Beginning with Processing

I am using the book called ‘Learning Processing’ by Daniel Shiffman. There are a lot of books out there on Processing but I chose this one because every chapter almost feels like a lecture and it is organized for a semester course. It is the same book he uses to teach at NYU. And he knows his audience very well, that is, people who have NEVER programmed before. This will be the one of the three books I’ll be referencing during the semester. The other two will gain their mention later in the semester when the subject matter becomes relevant.

On to this week’s lesson…

We start by getting familiarized with Processing’s interface.Processing Environment

The fun thing about Processing is that the development environment is so straight foward and visual that applications are simply called sketches. Special functions for drawing geometrical shapes are readily available. One key idea is that with Processing, you are creating visual forms drawn by pixels. So a point drawn is simply the position of a pixel in the screen.

The syntax to create an animation simply consists of calling the function draw(). Whenever you want to have a sketch interactive with the user, mouse input data can be accessed from any function by simply using mouseX and mouseY.

Color can be modified easily by RGB or HSB standard. Every single pixel can be colored and fun gradients of color can be programmed by playing with transparencies.

A lot of the examples in the book will have to do with this creature, Prof. Shiffman called Zoog. He likes his ‘creatures’ and a lot of the projects will have to do with creating creatures whose algorithms implement specific programming techniques. I have taken my creative license so I will probably stick with more abstract forms.

My preliminary sketch for my week's composition

My preliminary sketch for my week’s composition

Each week, I’ll be creating at least one composition to reinforce the concepts learned. This week was all about drawing shapes and making those shapes dynamic by using mouseX and mouseY inputs. I immediately thought of cone lights so decided to create a colored composition with an array of triangles whose color changed and vertices moved according to the mouse

You may play with my sketch by visiting the following link:

http://www.openprocessing.org/sketch/213101

See you next week.

Intro – Visual Compositions by Autonomous Agents using Processing

I have always been very fascinated by computational design and generative art. That weird realization that these lines, curves, shapes are drawing themselves and they are acting intelligently based on a set of rules and interactive events with the user made me feel a little uneasy. Mostly, because as an architectural designer, we are pretty much only taught to simply point, click and draw and I couldn’t help but feel a little inadequate with the way I do things. Needless to say, we, designers who are used to create with their hands and minds use other processes and techniques to create and the end results can be just as beautiful as any sophisticated algorithm-based composition. But I still felt jealous. I wanted to try coding and I wanted my code to do stuff that is simply too difficult for me to do by hand.

This semester I will be learning Processing, a programming language designed for media design (images, animation, sound, data visualization, visual compositions, etc). It can create stunning interactive visual compositions that rival Picasso in their abstractness and randomness.But the real deal lies in the fact that with it, designers in all fields can implement algorithms to generate art in a straight-forward scripting environment. As it is built on top of Java, the first thing most programmers learn in school, I wanted to use this tool as a foundation for later high-level programming languages like Python, Javascript, and C#, which can help you do amazing things in 3D modeling software.

But learning Processing is just one part of it. I needed to fulfill a more specific goal. How can I use Processing to help me design architecture? Also, how can I make my project fit within the context of the Living Environment Lab? Well, programming languages are great for simulations, after all, almost all phenomena can be described in terms of a set of rules and that can be coded. For example, physics engines for games simulate physical interaction between objects based on a set of rules. Could I simulate an environment and a group of entities interacting with it according to guidelines, e.g., this thing will move away as soon as it comes within 50 pixels of distance from another entity, the group of entities spends most of its time in the center, or to the right, and so forth. The way we interact with our living environments is really all following a set of rules. What if I could create a floor plan that informs its parameters of form based on a simulation of the interaction between function of the space and users living in it? That’s how I came across this idea of simulating with ‘autonomous agents’, independent entities that behave according to rules in the code, and their application in the design of architectural form and space. My goal this semester is to create a visual composition that uses a number of agents and their rule-based interactions to generate form using Processing.

Form-finding using Agents

Form-finding using Agents

More on autonomous agents and agent-based modeling will be covered throughout the semester.

Initial Pilot: Thoughts on Procedure

I ran a few people through the baseline pilot last week; data’s not ready yet, but here are some thoughts on the general process, and participant feedback:

Things are running two to three times longer than expected; automating measurement may cut this in half.

There may be a kind of fatigue effect from being in the virtual environment too long, losing what sounded like a sort of calibration between proprioceptive and spatial senses; only one of four participants reported this, so there may also be different internal models at work between them.

Participants report being aware that only two distances were being presented; it was suggested we might test continuous distances along our range of interest.

End of Semester Wrap Up

1) Describe your final project/studies. What have you accomplished over the course of the semester?

2015-05-09 14.22.34I had a show!  While none of the pieces fully functioned the way I planned, I’m happy to say that I did pull together enough to put on an exhibition that I felt was pretty well received.  There was a lot of enthusiasm about both the garments themselves and the technologies integrated into them. I’ll review the final outcome of each garment below..

Inflatable dress:

I was very happy with the overall silhouette of this piece.  The fundamentals of the CO2 inflation system worked perfectly and the effect was awesome.  Unfortunately, the electronics of the piece ceased functioning in the 11th hour, so the piece as shown in the exhibition was triggered manually.

Speaker coat:

In the end, I had to abandon the textile speakers.  I was simply unable to get them to be loud enough for this application.  I was able to harvest some small, rechargeable speakers that fit great in the collar and had great volume.  The Lillypad MP3 didn;t end up working for me, as I was suddenly no longer able to upload code to the board, so the finished product simply played music, rather than being triggered.

Hoodie sweater:

This piece was one of my biggest disappointments.  The sweater panels that Dennis knit for me are unbelievably gorgeous and the sweater itself came out perfect.  But, it turns out that at some point during the process one of my servo motors stripped a gear and was no longer able to fully rotate.  Since the electronics of this piece had already been tested months previous, I made the mistake of leaving the final assembly and testing of this one until the end, at which point I didn’t have any resources to replace the motor.  The exaggerated silhouette created by the hood frame no longer made sense without the mechanics, so I decided to remove the framework and show the sweater on its own.

LightPrint top:

This piece actually got closest to where I intended.  The 3D printing via Shapeways didn’t work out, so I ended up printing the neck piece in flat sections using a flexible PLA filament and I was very pleased with the outcome.  As I suspected, the LED strip lights weren’t as bright as I wanted, keeping the lighting effect concentrated around the neck rather than diffusing through the entire garment.  The elimination of the PIR sensors from the other pieces combined with the challenges of coding an analog interrupt led me to pull the sensor from this piece as well.  Instead, I coded a continuous, soft rainbow fade.

Spines top:

This piece ended up eating a lot of my time and was ultimately the one I was unable to show.  Once I started casting the spines, I quickly realized that I didn’t have the time to make the 400+ I would need for the top.  I changed track and developed a version of the top that utilized plastic zip ties as the spines.  This showed a great deal of promise in testing and I started working on the first spine panel for the top.  Unfortunately, after 4 hours of assembly I only had about an inch & a half of finished work.  At that point I set the project aside in favor of the other pieces.  I’ve already mentally reworked this piece to make it a little more achievable, so I’m looking forward to completing it in the near future.

2) Describe your overall feelings about the project/studies. Are you happy, content, frustrated, etc with the results?

I think it’s clear that I had some significant frustrations with this project.  I’m incredibly disappointed that I was unable to achieve the final outcome I intended.  However, I am proud that I rallied to an extent and was able to put forward a complete collection.

3) What were some of the largest hurdles you encountered over the semester and how did you approach these challenges.

Obviously, time was the enemy this semester.  The biggest challenge was the time I lost to my husband’s recovery, both the weeks where I was home with him and the ongoing challenges of his changed day-to-day needs.  This put me in a situation where I was simply unable to dedicate 100% of my time to this project and that bit me in the end.

My other hurdle was my own enthusiasm as compared to my level of knowledge.  I was trying a lot of different techniques and pursuing a large variety of new skills/technologies simultaneously and I think I got a little overwhelmed, especially once it was crunch time.  One of my ongoing challenges is that I know enough about the tech to get started and explore, but not enough to effectively troubleshoot once issues arise. I’m looking into pursuing some collaborations in the future that would allow me to take my work further.

4) If you had more time, what would you do next on your project/studies?

Fortunately, this isn’t a matter of “if.”  My plan is to complete these pieces to their intended outcome this summer and then hire a videographer to document the work on actual human bodies.  I think this will help get across the intention of the pieces more effectively.

End of Semester Recap – Spring 2015

Summary; Accomplishments

This semester started with reading papers; there’s a large body of work about perception in AR/VR, and my research would benefit from a ready set of references. Some of the topics I’ve now supporting references for:

  • decline of accommodation with age
  • a variety of calibration techniques
  • various depth cues in 2D and 3D
  •  feedback effects (tentative, these need more investigation)
    techniques for measuring perceived distance
    theories of perception in virtual spaces (though these seem a bit thin)
  • The current experiment has also been refined, and a new pilot in Unity should be complete in the coming weeks.

I’ve also done some work for my optimization class project that might be helpful to other projects in the lab; for xZ = y, generating matrices Z given known good x and y should be simple; it may also be possible to generate xs, given a promising set of ys.

Challenges

The lit review almost became a paper in it’s own right, but finding a recent survey made that a more complicated task. There’s still something there, some inconsistencies across papers, angles the survey doesn’t notice, but the path to a paper discussing them is less clear. Rather than a single paper, they may become separate investigations. There may also be room to adapt other lit aggregation techniques, like meta analysis, though it remains unclear how directly these techniques apply.

Organizing information found in the literature has been a challenges. There’s also a lot to keep straight: chains of support, who knows what from which papers; open questions, conflicts, and other things bearing further investigation … it’s already a complex web of interrelationships, and I suspect I’ve still only done a rather shallow exploration of the space of relevant papers. I need a better way to organize this.

Pilot development stalled a bit, as I decided what tools to use. An increase in the demands of my classwork about halfway through the semester derailed attempts at custom code; a shift to Unity means less labor intensive, but perhaps less adaptable, experimental tool development.

My Feelings on the Results

I’m a little frustrated things aren’t moving faster, and that I don’t have more paper write-up posts to better record what I’d found in my readings; I’m a bit frustrated that I don’t have a better command of the things I’ve read, a better system to lead me quickly back to the bits of interest, as interest arises.

But I’m happy to have had the exposure: I have a better sense of where the field is at, and where the current research fits. And somewhere in a giant (virtual) pile of papers, I have the references to support whatever I might write in the future; finding them might not be as efficient as I’d like, but it should still be effective.

Next Steps

In the next few weeks, the Unity pilot should happen.
Based on its results, the research develops in whatever way seems most promising.

Some paper and notes organization system will remain a side project, as might my custom experiment code.

What a wild ride…

1) Describe your final project/studies. What have you accomplished over the course of the semester?

In a lot of ways I feel that I’ve accomplished more in the past five months than I’ve been able to do my entire time in graduate school. The reason for this sudden influx in productivity? I stopped working for other people and really focused on what I wanted to do, and did it. My final project is my thesis exhibition, Horse Power. It is a multifaceted project that involved creating a collection of 22 garments, two leathers bags, two pairs of socks and one hat, for a total of nine complete looks. I directed a photo shoot that has been featured on thefashionisto.com, directed and produced 9 and a half minute video installation using two large scale projected videos running in sync, choreographed a live fashion show with a live music by a beat boxer, produced a 24 page look book, created a website, created a gallery installation with a 24′ reclaimed barn board wall. That on top of collaborating with Hybrid Salon on a costume for the Hair Affair fund raiser at MMoCA in late April, participating in the Graduate Student Showcase in the Ruth Davis Design Gallery, and helping to produce the 2015 Threads Fashion Show: PULSE.  I’ve done a lot.

2) Describe your overall feelings about the project/studies. Are you happy, content, frustrated, etc with the results?

It’s pretty safe to say that my hard work has paid off, or at least “is paying off”.  I’ve received tons of positive feedback on both the gallery installation and the live show. I’ve been featured in articles in both the

Cap Times PULSE

and thefashionisto.com Cory Allen goes Equestrian

I have lots of new contacts in the fashion industry from people who came up to talk to me after each show. I’m looking forward to talking with investors next week to see how I can continue to work on my brand and make Cory Allen a real name in the world!

3) What were some of the largest hurdles you encountered over the semester and how did you approach these challenges.

There were hurdles to jump at every turn, basically, but they never seemed insurmountable. One of the biggest challenges with the collection itself was the production of the two leather bags. I was working with a woman in Mineral Point who runs a saddle shop there. I didn’t do enough research on her work, and she ended up nearly destroying the bags, which are both made of Horween Leather, and horse tack. Luckily, after I got them back I found John and Kelly Fallon, through my shoe repair guy, and they were able to cut them apart and remake them. The final product is not a showroom sample, but they are much closer to what I designed. The big learning moment here was how to communicate and keep tabs on the manufacturing of your products. I trusted the saddle shop too much, and it almost cost me about $600.00 worth of leather. The great thing that came out of it was meeting Kelly and John. Now I know who to work with, and even have a list of manufacturers if I put the bags into production. I’m hoping to work on new prototypes with them this summer.

Technology is always a hurdle for me. I worked with video producer Aaron Granat, and while he does really nice work, it was very frustrating waiting for the videos to be done, we were way behind schedule, and there are definitely things that I would change if I could. Overall I think they turned out AMAZING. After my initial idea of four projections in the space-creating an imax experience- was found to be impossible, I decided to use only two projections, and the results are really beautiful. I think the video still creates the sense of atmosphere I wanted. Re-working my original idea for the video for two screens actually made the final film much more interesting, in my opinion. I kept the night arena scene, and it is breathtaking, but I also added a sort of “campaign video” and a fashion show video through the barn. With a little clever editing the fashion show walks right through the gallery, and I’ve really enjoyed seeing people experience that.

I also was going to work with a composer in the school of music on an original score, but that fell through, so I ended up finding music for each set of the video. I’m not sure how I’ll be able to use the video in the future, because I don’t own the rights to those songs.

The other challenge was trying to balance the creation of Horse Power with my other duties as TA, and the shows and collaborations I did in addition to this project. I didn’t sleep much, but I’m really excited about a future where all I have to do is work on my own thing, and not feel torn about that.

4) If you had more time, what would you do next on your project/studies?

This is one of the rare occurrences where I actually met and/or exceeded all my initial goals. The things I’m still working on now that the shows are over, are developing my website, creating line sheets and tech packs for all the garments and accessories, and marketing this collection and my brand out in the world. I’m riding a lot of momentum from the show, but I know that I need to follow up with all these new contacts, and keep this train rolling!

5/15/2015 Final Semester Update

To sum up my work this semester, Professor Ponto has asked me to answer some questions about my project.

js

1) Describe your final project. What have you accomplished over the course of the semester?

TEB is a thermoelectric bracelet that can be used for personal body temperature regulation. The current prototype uses a thermoelectric module in combination with a microprocessor to send automated pulsated thermal stimuli through the wrist to induce a perceptual change in body temperature. The effect is similar to putting your wrist in cold water on a hot summer day. This semester, I completed prototype 1.2, which was mainly composed of fixing issues that plagued with the first iteration prototype.  I had to redesign the circuitry and then also rewrite many aspects of my code to accommodate those changes.  I spent the majority of the semester testing and troubleshooting circuitry issues, but after many hours in the lab, I was able to get it working to a point where you can actually feel the pulses of cool stimuli running through your wrist.

 

2) Describe your overall feelings about the project. Are you happy, content, frustrated, etc with the results?

As with any engineering project, there are times of frustration and times of great satisfaction. With this project, it was particularly frustrating to see that the root cause of all my problems stemmed from my lack of understanding in the difference between P-channel and N-channel MOSFETs.  This problem really slowed me down and as a result, I did not get as much done as I would’ve liked this semester. However, I did learn a lot about circuit testing and analysis methods because of this and I am glad that I figured out what the problem was

In terms of how well the device worked, I am very happy with its performance. The pulse frequency on the current prototype has by-no-means been optimized, yet it still cooled me down and made me comfortable during the symposium that I presented at. I was impressed with how quickly the the thermoelectric module can heat up and cool down.  Still though, the prototype is too bulky and not impractical and requires size reduction in order for this to be feasible.

 

3) What were some of the largest hurdles you encountered over the semester and how did you approach these challenges.

As stated earlier, the most difficult part this semester was identifying the circuit design flaw that was causing the circuit to short. To solve this issue, I used a systematic approach and tested each subsystem (i.e. voltage boosting section, H-Bridge section, USB charging section, LED section, and Processor section) using various methods and eventually identified that the H-Bridge configuration was causing issues. From there, I analyzed each component in the system to ensure it was soldered properly and that there were no bridges. I didn’t make much headway with that method so I removed individual components and tested it until it worked. Eventually, I found that when I removed one P-ch and one N-ch MOSFET from the board, the circuit worked. From this, I was able to determine my error in design.

 

4) If you had more time, what would you do next on your project?

 Revisions for Next Iteration

  • Minimize size to make it less cumbersome
  • Add heatsink to side that is contact with wrist
  • Use FET array chip instead of current configuration
  • Discrete processor chip instead of an off-the-shelf board
  • Remove voltage boosting circuitry
  • Use elastic band instead of watch band
  • Integrate circuitry into the band

Future Work

  • Redesign current board based on revisions stated above
  • Optimize pulse frequency to maximize the brain’s perception of your body changing temperature
  • Perform user study to see if it improves subjects’ thermal  comfort in warm or cool environments
  • Publish results

 

Build the first demo

I was focused on course projects and TA work for the past two weeks, so I didn’t make too much progress. Now I have built the first demo. I can move the tablet to see a cube from different angles.

The pose data structure returned by Tango actually describes the position of the Target frame in the coordinate system of the Base frame. So if I want to transform a vector from the first frame to the current frame, I need to invert the matrix.

The transformation formula on the document is slightly different from that in the sample code. The sample code version adds another term so that the eye space is aligned to the color camera coordinate system. The document version aligns the eye space to the “device” coordinate system, which is at the center of the tablet. Perhaps this matters for AR applications?

As time elapses, the cube shifts away from its original position. This is because the Motion Tracking module only computes the transformation between two consecutive frames so error accumulates. Maybe the Area Learning module can help with this.

Final Weeks of Classes

Mostly classwork this week and next — final homeworks, exam, and project.

For project: the simple base case is solved (as linear, which should be fast). Next is either a branch-and-bound exploration of possible set selections / correspondences via MIP, or modeling x -> y mappings as a series of Z matrices over “time” and minimizing change of the Zs.

For the Pilot: Looked at what a one-axis distance metric does. Vertex-sensitive distortions are less of an issue, but curves are noticeably distorted in the periphery. Overall less distracting than the vertex-sensitive distortions seen with 2D.