AR and ABM with Unity + NyARtoolkit

This work was done as a part of the group project we are doing in the Spatial Simulation and Modelling module in the M.Res, CASA. The project team is Daniel Lam, Ayana Kito, Nicola Clark and myself and the overall theme is “Living city”. As a part of the exploratory phase I was working on Augmented Reality(AR), 3D (glasses) and Kinect as potential tools for the project. The idea for the exercise was to explore to find out the most suitable tools available to implement a strong AR component and to make a demo to demonstrate what can be done with them. The result is as below.

This a screen grab from the unity application running the scene. The model and moving agents were done by Dan (link). The AR is built using NyARtoolkit from here. The challenge here was to understand the workings of the NyARtoolkit for unity which has virtually zero documentation and tutorials  online, which I think have been overcome substantially. After 2 weeks of (inefficient) work on this now I am considering shifting the whole focus to figure out the other plugin for AR – Vuforia by Qualcomm. Will be posting regularly on futher developments regularly.


Cellular Automata and Game of Life.

As a part of the digital visualisation module with the M.Res Programme, we were building cellular automata models with processing. The exercise was really interesting especially the Conway’s game of life where small amount of rules and coding generates a animation which is sometimes rich and endless. To be more specific the model is set in a plain canvas which is divided into equal grids and each cells is either alive/dead. There are three rules

  1. If the number of neighboring cells (n) of a cell is less than the loneliness limit then an alive cell dies
  2. If n is more than the overcrowding limit then an alive cell dies
  3. If n is equal to the creation condition then a dead cell becomes alive and rest stays the same.

I was experimenting with the same model and was trying to create something out of the game of life model by changing some of its rules. The results are as below,

1) Original Game of life:

Here the parameters are, loneliness limit = 2, Overcrowding limit = 3 and the creation condition = 3. This is by far the most interesting set of parameters which creates a life like situation where organic patterns emerge and spread and die. It even results in some mobile ‘organisms’ which can move along the canvas.

2) Space Filling Fractal:

Here the parameters are – Loneliness limit = 2, Overcrowding limit = 1 and the creation condition = 5. When the initial condition is a alive cell in the sides of the canvas (not the corners), the alive cell goes on to create a fractal growth which kind of fills up the space.

3) Sierpinski’s Gasket:

Here the parameters are – Loneliness limit = 2, Overcrowding limit = 2 and the creation condition = 1. When the initial condition is such that all the cells in the diagonals are alive, it goes on to create a Sierpinski’s gasket in the corners of the canvas.

4) Growth and Edges:

Here the parameters are varied through out the simulation and it shows how an object can be created by using a normal initial condition and using a combination of parameters (please note that the parameters are actually changing during the video) which are controlled manually. Even the edges of the object generated can be isolated by just changing parameters.

The code which resulted in the above videos can be downloaded here. The instructions are as below

  • press ‘r’ to reset the canvas to blank.
  • press ‘u’ to start or stop the simulation.
  • click and drag in the canvas to introduce alive cells.
  • press ‘a’ to introduce alive cells all  along the mid points, press ‘s’ to introduce alive cells along the diagonals and press ‘x’ to introduce both.
  • press ‘-‘ or ‘+’ to decrease or increase the overcrowding limit and press ‘[‘ or ‘]’ to decrease or increase the creation limit.

Have fun. p.s You need to have processing to run the above code. which can be downloaded here.