Galaxy Here and Now
A simple galaxy based on the environment could be created, which could be controlled through Leap motion.
produced by: Junqiao Luo
Introduction
This work, galaxy here and now, create a galaxy from this moment and the space you stay. My idea comes from a service from NASA recently. The topic called “What Did Hubble See on Your Birthday?”, aims to show what Hubble look at on every user’s birthday. It’s very cool to give different users different results. Based on this thought, I designed this project similarly but using openFrameworks and Leap Motion to provide some interactions.
Content
Before interaction, this work starts with the camera, showing the camera image in the top left corner of the screen. With the 5 seconds' countdown, the frame of the fifth second picture is captured and stored as the data of the subsequent process. First of all, the dominant hue in the image is identified through hue value of each pixel and used as the dominant hue throughout the galaxy. After that, the background is decorated with 1000 small stars of random size, using the color gradient of the color department. Create a 3D galaxy and paint stars of different sizes in that color range. The larger of these are painted with the light of a cross by cone function. Use the pixels stored at the fifth seconds and find the brightest point in that frame though brightness value, then draw a planet in the corresponding location in the galaxy. The planet will use a texture in the same color.
After the galaxy set up, the interaction with Leap Motion are enabled. The machine learning model uses processing of Leap Motion as input model(the original version comes from Wekinator website), which includes 15 inputs of locations of 5 fingers, 4 mathematic inputs for distinguishing finger gestures, and 90 inputs in time buffer for dynamic gestures. After training through Wekinator, the model as output can achieve rotating and zooming functions. When the hand put on the left, the galaxy rotates to the left. The rightward rotation, downward rotation and upward rotation are in corresponding way. As for zooming function, the galaxy zooms in when drawing a circle clockwise, and zooms out when drawing counterclockwise.
Technical
Hardware: Camera, Leap Motion
Software: openFrameworks, Processing, Wekinator
Future development
There are many shortcomings in this work that need to be improved. Firstly, there is big uncertainty in the color recognition of the picture, especially when the light is unstable, it is easy to mistakenly classify colors. Second, calling the 3D model a galaxy is a bit far-fetched. For galaxies, it's a bit simplistic and doesn't fit the variability of galaxies. Optimizing the model will also make the work better. Besides, it’s better to find any other proper interactive way for gestures, since that this work ask for Leap Motion as a device currently.
Self evaluation
This work uses various functions flexibly, such as 3D function, videoGrabber, HSB, Osc, and generally achieves the effect I expected. Interaction has been set up mainly based on Leap Motion. Through this project, I learned how to use Leap Motion by self-study, and have deeper learning of interaction, graphics and such creative coding. The galaxy might be not perfect enough, lots of details needed to be enhanced.
References
- https://www.nasa.gov/content/goddard/what-did-hubble-see-on-your-birthday
- http://www.wekinator.org/examples/