Friday, September 02, 2011

Objective C Perlin Noise

As promised, here is the port of the's Perlin Noise code to Objective C.
This is beta code so use at your own risk. It's what I used for the HTorsion part of the Grow Your Own app.

It works almost the same way as the's version. You can find the reference for that over here:

For some horrible sample code, here's what I have for one of my functions:

noiseVal = [noise noiseX:(x1 -xCount)*noiseScale Y: (y1 -yCount)*noiseScale Z:noiseCount];

So, as you can see, it's similar to the version.

Anyways, the source of the code can be found here:

Please don't expect any help on how to implement it. It's not because I don't want to help. It's because I have a horrible time looking at my old code and figuring out what exactly did I do to get it to work.

Sunday, July 10, 2011

Grow Your Own

Screenshots of my 3rd iPad app that is still a WIP

"Grow Your Own" iPad App

This is the second in a series of art-centric applications I am developing. Released on July 1st, it actually did fairly well in the "Entertainment" category. It hovered around the top 100 in the US charts and reached top 50 in other regional charts. Not bad for something that didn't have any advertisement or press to it.

The app is actually 2 algorithms in one. The first is a variation of the Brooklyn Eels algorithm and the second is the port of the HTorsion algorithm.

This app required me to port the Perlin algorithm from Processing to Objective C. In a future post, I fully intend to release the source for that so other generative artists can use it.

Development of this app really made me focus on the memory management of the application. With the limited 20 Mb of memory an application is allowed to use, I had to learn how to manage memory better. Spent about 2 weeks trying to trace a memory leak.

Well, I feel like I'm growing as an Xcode programmer. Unfortunately, I still find the process very tedious. I might explore using Cocos2D or Corona SDK in my future developments.

In the meantime, below are sample images generated by the app:


Grow Your Own iPad App

Grow Your Own iPad App



Sunday, February 20, 2011

Honey, does this dress make me look fat?

"Honey, does this dress make me look fat?" iPhone App

At one point in every male's life, they have been asked this trap of a question. I tried checking the App store for an app and was surprised to find that there was no app for that.

I figure it would be a quick program to create an app that would analyze someone and see if the dress makes them look fat so I gave it a try. This app is a gag gift. Results aren't meant to be taken seriously. In reality, the answer is determined by the user. All this app does is deflect the blame onto the app and away from the askee.

If you have %.99 to blow, give it a whirl. :-)

Saturday, January 29, 2011

Tempvus Version 1.0.2

So I failed to mention that the Tempvus iPhone app did fairly well considering the lack of promotion for the app. It is currently free at the moment.

As promised, I ported the app to the iPad with version 1.0.2. I feel that the platform serves the art world the best.

Here is a quick screener/demo of the application and along with some screenshots:




Friday, December 17, 2010

Tempvus App


Tempvus 1.0.1 iPhone App

Tempvus is an interactive art project/toy involving flowfields. It’s based on interaction-based behavior which manipulates the final output of the image.

You can interact with the app to add spinner objects, change the direction of the spin, the strength of the spin force, change the color, or move the graviton object.

You can download the app by clicking this link.

Challenges of Creating the First iPhone App

Five months ago, I took the plunge and decided to take my work to the iPhone. My intention was to create apps that would be displayed on iPads. My vision was to have a gallery of apps on the iPad.

It took me a while to get this project done due to technical, transitional, financial challenges. It also took a long time because I wrote the App only during my spare time. As programming code is only a hobby and not a fulltime job(I'm a Cisco Network Engineer by day), I can only sneak in a few snippets of code every day or two. There were times when I didn't touch the code for weeks as I simply did not have time. I'd rather spend that time playing with my baby than code.

So here are a few challenges I encountered:
  • Financial Challenges
The ultimate goal of this work was to get these apps to the iPad. At the time when I first started writing the app, I only had an iPhone. Writing an app for the iPad would mean I would need to plonk the money for an iPad. This wasn't too much of a problem. My wife wanted an iPad so I got it for her with the intention of using her iPad for development.

What I didn't know was that for development, that means I would need to home her iPad to my Mac instead of it being homed to her PC. This provided challenges because that means I'll have to wipe her apps each time I want to develop on the iPad and it also means she'll need to wipe my code and apps whenever she wants to use her apps. It's quite a mess.

We both decided that we'll need 2 iPads. One for her and one for me. I needed one for development so eventually I had to wait until I can justify the purchase of another iPad.

  • Transitional Challenges
The next challenge had to do with porting my Java Processing code to Objective C code. I wrote C/C++ code 13 years ago and I barely remember how to code with C/C++ and OpenGL. I had to read a couple of books to learn how to use Objective C.

The challenge was porting my Java code to C++ code. My approach was a straight conversion of the Java classes to Objective C classes. This was a straight translation of code without any change in the way the algorithm is implemented.

Upon completion of the translation, I soon found out that I had a lot of typos in the equations and algorithms which caused a lot of problems during the translation. It was difficult tracking down where the errors in the calculation were occurring as there was a lot of code to eyeball. Eventually I found all of them and got them fixed.

One of the major differences between Java and Objective C is garbage collection. I take this for granted when coding with Java. Objective C has no automatic garbage collection so your memory management skills have to be on point. If you don't manage memory properly, your app will crash a lot. Relearning this skill wasn't too difficult but it sure made me learn how to be a better coder.

  • Technical Challenges
When the code was finally transitioned, I soon found out that a straight translation will not work. For one thing, the coordinate system for Java and OpenGL are different. Java's default coordinate system is the actual pixel dimension of the window. OpenGL has a scale range of -1.0 to 1.0. This means I had to re-tweak the code to accomodate the differences. Later on, I found out I can rewrite the OpenGL code to mimic the coordinate system of Java.

The next challenge is that I needed to optimize my code to the maximum. I've never coded for a system with limited resources before. I'm used to coding on powerful systems like Macbook Pros and never had to optimize my algorithms that much.

Coding for an iDevice is different. You have limited CPUs and memory to play with. I had to take my original code apart and optimize it. I had to re-write chunks of code so there are fewer loops and fewer function calls. I also had to re-write some functions in straight C to make it faster.

Objective C is a dynamically linked language. Although this is a feature of a language, it is also one of the things that slows it down. For each function call, the system has to allocate a new memory pointer. So for a huge for-loop, each call to a function takes a lot of resource and time to allocate the memory space.

Optimization was where I spent most of my time. Through function tweaks, compiler tweaks, and reconfiguring the code to have OpenGL use the GPU more, I was able to make the app faster than it's original form. I'm still not as happy as I want but it's acceptable right now.


The app is currently under review from Apple so it should be launched soon.

Eels of Brooklyn

Been busy with working on the iPhone app. It's currently under review and it should be up on the iTunes store anytime now. In the meanwhile, I've been keeping myself busy with some more generative work.

The following are images from my Eels of Brooklyn work. It's currently unfinished and is still a work-in-progress:

Coney Island Eels

Coney Island Eels

Coney Island Eels



I was inspired by a visit of the Brooklyn Acquarium.

Sunday, October 03, 2010

Expanding the Medium

My original interest in computational design was interaction. I used to program a lot of interactive toys similar to what was popular in the early 2000s when Flash was getting popular.

My interest in interaction did not hold because it started to move towards developing 'final' images as art. So interactive art was only a means to develop static art. I've always wanted to be some sort of artist and I couldn't really draw. I stunk with Photoshop and the only joy I get with generating art was in programming. After a long while with tinkering with interactive arts, I started focusing on "finished art."

My move towards art on a static medium is what prompted me with starting this blog. I still develop a lot of interactive toys. All images posted on this blog are generated with interactive algorithms. The only difference is that the interaction is solely limited to me as opposed to posting the interactive piece online for everyone to play. This gives me more ownership of the images.

After a few years of this, I am a little bit frustrated that the Algorithmic/Generative/Computational art genre has not gained a lot of acceptance in the world. It is still a growing genre and is experiencing a lot of resistance in the art world. The growth pattern is akin to the resistance to photography as an artform.

I sometimes find myself arguing with critics about the legitimacy of this particular art and I yearn to find more exposure for this genre.

Enter the iPhone.

A few innovative souls like Glenn Marshall and Scott Snibbe has started using the iPhone as a platform for their art. Why not? With the advent of the iPad, it is a viable platform to display your digital art.

I aim to take advantage of this.

So the plan for the next couple of months is to port some of the interactive toys I created to the iPhone and either give it away for free or sell it for a dollar. The intent is to generate awareness of the brand. I'm hoping people will like the little art-app enough to maybe...just maybe purchase a print or two. Of course, if the art-as-app app takes off, I'm hoping to get a little bit of return from it as well.

So...that's the plan for now. We'll see where it goes.

Below is the first iteration of the first App I am producing. It should be ready within a month and available for free.


Watch out for the new interactive wing of called will be the official website for the iPhone projects that I will be working on. I'm hoping to port some of my art-apps on the site. Also have a couple of games in mind as well.


Sunday, September 19, 2010

Wild Things

What The Wild Thangs Are

Wild Things java application, October 2009

This work is another application of the attractor program. It actually started off as a study of vector physics but as I started learning it, I started applying it right away.

The concept is simple. Random particles are generated on the screen. Each particle is attracted to the nearest attractor. As the particle heads towards the attractor, it may encounter a spinner particle. Spinner articles exerts a vector force on the particle causing the particle to spin around the Spinner.

Each attractor and Spinner has a corresponding twin so that there is a balanced set of particles on each side of the screen. When the particle gets between a certain distance to the attractor, it regenerates at a random coordinate.

Particles are coded to leave a trail of their path.

The intended results are to create an image that resembles a mask or face of some sort. My original intention was to create masks that would be used for Halloween.

The following are more sample images:

What The Wild Thangs Are

What The Wild Thangs Are