Tuesday 18 November 2014

Final Work Reflections

This project (now named Ansa++) has been a long and far reaching one, which has required a bunch of skills, some that I already had some that I had to learn.

I'll list some of the skills I had to learn first and then skills that I had to get from other projects.

  • Objective-C
    • This language, while not fundamentally different from C++ has some complex interactions with UI elements that take some other time to master (or at least to get functional).
    • I had a great many problems getting the UI to work as the UI-language interface is confusing to someone who has not been brought up programming Macs.
    • Objective-C does memory allocation in a very different way to C++. This brought about many problems during my attempted use.
    • I have no mentor, most of the Obj-C that I know is learned from the documentation, which couldn't be more confusing (what the hell is a predicate?).
    • Next on the list for Obj-C: write an entire application in Obj-C.
  • Cocoa
    • A lot of my problems/issues with learning this is that I have no-one to teach me how to properly structure an app like this, and how to make sure that it is "production ready" 
    • I had some issues trying to implement things like dragging and dropping, and lists of videos, due to my lack of proper understanding of the interaction between the Cocoa and Obj-C. I eventually settled on an NSArrayController (an inbuilt helper class designed to maintain the order and workings of NSArray objects).
    • I did learn how to feedback information to a UI element from the rest of the program, and pass values from, through and to different programming languages.
    • I learned a lot about creating the inbuilt UI elements for the OSX system (file dialogues, question popups, sliders, buttons, switches etc) and how to implement their inputs in Objective-C.
    • Next on the list for Cocoa: multiple control windows, that can be opened and closed from a master window.
  • OpenGL/GLUT & Objective-C & OSX Windowing system.
    • I started using a version of ofxNSWindower, which quickly became super modified, to enable me to automatically select the last display, and use the whole display as a borderless window.
    • Unfortunately all the other modifications I wanted to make made the program horribly unstable.
  • Design
    • UI
      • I think my UI design for the project was satisfactory, some things still need to be made (the ability to return to windowed mode) but for the most part it is functional.
      • The buttons all have feedback.
      • Every element that does not cause a momentary effect displays the status of the system by nature
      • My UI is consistent in terms of the functional elements and the values are only displayed where it is necessary to keep clutter 
    • Functional Design
      • In some places I have limited the interaction to where it is necessary and not confusing, for example, it is not necessary for the user to be able to control the individual length or order of the videos, and hence they are not given the opportunity to do so, as controlling the individual length would be impractical for over 2 videos (the use case that this was designed for).
      • In one case I neglected to account for user/programmer error (returning to windowed mode), because I believe that I can fix this (it is a known problem, however it doesn't affect the general operation).
      • I implemented a number of low level features which enable this program to be so responsive and not as resource hungry as it could be, for instance I noticed that the video player objects took up a couple of extra processor threads due to their asynchronous threaded loading programs (I used a wrapper for the Audio-Visual Foundation framework) and so I decided to, instead of adding a new video player object to the end of the array that I was storing them in (and have a good 3-20 videos load at once), I created one array of video players, and within each polygon object, made an array of pointers to those specific video players and bound the texture of the current player to the polygon, and from the parent class I paused rewound and (if in use) played the videos required. This allowed me to get the videos to change fast, load fast, and have no noticeable lag when adding a new video to the loop (it doesn't actually add a new video, just a new pointer).
      • I enabled the saving/loading of polygons! This is a feature that I wanted to have done ages ago but didn't really have time for. i really should have saved them with a name other than the memory address of the polygon, but I figure its random enough (maybe later I'll use a timestamp, or a hash. Either way, it works, and it works well. I'm hoping to do a test where I can build the whole polygon map from home and then reload the objects an site 
      • I have still enabled the use of masking, however I have found it to be not as useful since finding out how to triangulate a polygon based on a line (the method I am now using).
  • Computer Vision
    • For this project I created a (plugin?) thing for automatic mapping of features!
    • Unfortunately it is still super alpha however there are a great many things that I have learned from this such as
      • Polygon triangulation
      • Proper use of an OpenCV wrapper
      • A little bit more about how OpenCV works and how its selection algorithms work things out
    • I made it so that you can import an image that you just took (even one that you took during the performance!) and make a homography of that image (place "in" points on that image and drag the out points to where it should be projected) so that selection of features from that image can done without the need to warp/crop using an external program and so that the homography can be done live.
    • I enabled the selection of different selection algorithms for OpenCV (so that you can select by RGB, or HSV or just hue etc)
  • After Effects
    • All of the clips for the video themes that I produced, were done in After Effe
Those are most of the new skills that I had to learn to do this project. On top of those I had to leverage my knowledge in the following fields:
  • C++
  • openFramewoks
  • Video editing
  • File IO
  • Object management
  • Classing and subclassing
I endeavoured to create some artistically interesting video clips to be used and to implement different ways to sequence and manage the loops.

Lastly, I wanted t give FPX a go, but I ended up not having the time, also I'm going to continue making themes for it (I wanna do a bramped sunrise/sunset theme).

The video below is of the final work being projected on the Peter Karmel building.