Recursion iPad App
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Recursion.xcodeproj
Recursion
.gitignore
Icon-72.png
Icon-72@2x.png
Icon.png
Icon@2x.png
readme.org
readme.pdf
status1.pdf

readme.org

AOR README

1 Object hierarchy

1.1 Group of objects held by root view

These aren’t held by other aorobjects.

1.2 Children of root objects

The distinction here is that root objects, and consequently their children, must linger.

For all children that have completed their animations, we should keep those around and just start the animation for children objects.

This entails remembering a recursive drawing session.

1.3 Root view

Changes to the root layer, this is where the fade out to an aorobject layer should be performend.

2 Performance

The performance issues that would be posed by drawing recursively were harshly underestimated. It turns out that making recursive object hierarchies is difficult to manage with graphical objects, and difficult to optimize as well. Running on the iPad makes this even more significant, as it has a much lower FPS than the simulator. This was a challenge in memory management.

2.1 Object life

Objects constantly redraw, they do this by creating new layers to draw on and add to the root layer.

2.2 Layer life

Layers exist as long as an object does, and for some time afterwards depending on user interaction, layers are removed from the root layer.

2.3 Ensure only children number of objects exist at each level

If there is a way to programmatically test for this that would be ideal.

2.4 Path destruction

It seems that paths must be destroyed, and cannot be reused.

2.5 Calculate distance between touches to determine draw rate

Layers/objects get created way to frequently between small user touch movements. Because Core Animation is laggy, we want to try to limit this number. By checking the cumulative, pair-wise distance between touches with equal number of points, we can refrain from calling object creation functions on too-close pairs of points/touches.

2.6 TODO Don’t keep depth 1 objects around

Because they are intermediate objects drawn while the user is dragging. They don’t need to be faded out and can be immediately discarded. Before removing a layer from root layer, ask it if it’s depth is maximum.

2.6.1 TODO Subclass CAShapeLayer

We’ll need to do this to know which layers represent small vs. dense objects. Add a depth field so it can be queried before removing from root layer.

3 Usability

3.1 Double-tap to change between themes

3.2 TODO A main menu

Short blurb on how to use.

3.2.1 Begin

Start playing around

3.2.2 Credits

Info on the project and us.

3.3 TODO Randomize themes

Would need a way to turn on random, maybe after you cycle through all the themes random is a “theme” too.

4 Visuals

4.1 Shapes

4.1.1 1 - 6 fingers

Shapes are drawn depending on the number of fingers down on the pad at once. The points define where the shapes get drawn to spatially.

4.1.2 5 finger default

Draw the simple star using default “good” points closest to the point of touching.

4.1.3 TODO 7 - 10 fingers

There is potential for this too. Just use the default “good” points mechanism from 5 fingers to create nice default fractals.

4.2 TODO Set 2 fingers to alternate between available shapes

4.3 TODO Set alternate shapes for finger configurations

4.4 Pick colors from a given set “theme”

Just a way to have the colors changing, and the themes would be recursive colors that go nicely.

4.5 Fade out dead animations while drawing new ones

This one should actually be easy. When redrawing the canvas, simply set the animation of the existing object to fade out, this should take effect immediately.

We always have one of each object. But in order to have an object fade out, and be able to create a new one, we need to copy over the layer. The object then creates a new one. Paths are always destroyed on object redraw.

4.6 TODO Find a way to change the stroke style

There might be a library of stroke styles.

4.7 TODO Some awesome visual effect library

To add a glow bloom effect, or something similar.