Table of Contents
Project Information
This project, titled "The Digital Wishing Tree" was the first project I worked on in my software development career. This saw the in house team at solarflare create an interactive digital wishing tree using a combination of technologies.
Solarflare Studio (Company I work for) have a labs of sorts. This is where the internal team will get together and discuss ideas of projects they can create with in house resources. These projects are often fun, crazy and show off the technology available to solarflare.
In this project I completed the majority of development (code). I worked closely with the integrated designer, lead creative and CTO. The outcome of this project was that I had gained masses of knowledge in both Unity3D and coding with C#. This project was extremely beneficial to my learning as a software developer.
Projection Mapping, Nanoleaves & more were used to achieve the final result.
Above is a brief showcase of the complete wishing tree. This is the finished product that we delivered at the end of the SDLC.
=> The project works via the following:
- Open webpage & Submit wish with a swipe action
- Watch the real life wishing tree installation
- Nanoleavs will light when wish lands on tree
- Existing wish will flow onto a static leaf and be written
- Lights will start reacting and lighting on the tree & nanoleaves
Design:
The wishing tree went through many design iterations. As I was the main developer on the project, I was not heavily involved in regard to the design process. That being said I still had an interest as I was to develop the tree based on the designs provided.
As seen from the image above the tree went through many iterations. Working closely with the integrated designer and creative lead we kept experimenting with the output of the tree. In the end we agreed on the design below.
Above, is the final design we decided upon. We planned to integrate more colours, but the tree shape and size was the conclusion.
Development:
Development of this project saw a multitude of languages, tools, tech etc used. I had to learn how to solder to connect the nanoleaves together using custom-made extensions cables. In addition to this, I had to pickup web technologies such as basic HTML, CSS, JS and PHP. These were needed in order to set up a local MySQL database to store the wishes.
Webpage & PHP
1 |
|
1 |
|
Above are the two PHP scripts I used in the application. These were used to retrieve the wishes from the database and also write the wish to the database.
1 |
|
The use case for the PHP is seen above. I set up a form in HTML in order to post the wish to the database. This was then retrieved within the unity scene.
The complete webpage looks like the following:
Unity Application
The unity application took a while to develop. This was a large project from initiation to deployment. Having to develop alot of different aspects of the project took alot of work.
The application was split into many modules some main ones being:
- Nanoleaves
- Wishes
- UI
- Network
- Animations
& alot more ^
Wish Pathing
For the wish pathing I decided to use Bézier curves. After watching tutorials on how to set these up in unity, I was able to integrate them into the scene with ease. Once a wish was received in the scene, I wanted it to spawn at various pre-defined locations. From these locations I wanted the wish to follow a wind blowing animation along this path.
To do this I started by creating the various wish paths to each leaf I wanted the wish to land on.
Animations
Animations was a very simple part of development. We wanted a way to have pulse like animations when the wish lands. To achieve this we simply used a sprite that scaled and fades over a given time.
We instantiate the pulse at the leaf that the wish lands on and play the pulse animation. We defined these early on in development as seen from the gif below.
Final Thoughts On Development:
With development complete I reflected on everything that had been achieved. The wishing tree took a lot of work from the team. From the application development alone there were masses of components that complete the functionality we were aiming for. That being said I enjoyed the development a lot, and it was a great first project to be involved in.
Challenges & Solutions:
There were many challenges that I faced during the development of the wishing tree. Below are some of the most challenging problems I encountered along with the solution/approach I took to fix them.
Finding Nanoleaf Controller
Perhaps the most difficult challenge was recognising the nanoleaves on the network. As we wanted this experience to be portable I wanted to make sure that no matter what network we are connected to, we could both recognise the leaves & link them to the unity scene with their authentication token.
Nanoleaves connect to the network via a controller. We discovered that every nanoleaf controller has a mac address of the following format:
00:55:da:xx:xx:xx
This was perfect because it meant that every mac address contains the string "00:55:da". With this we could scan the network that the device is connected to and look for any mac addresses that contain the string.
1 |
|
With the code above we could recognise and control any nanoleaf controller on any network that the device was connected to.
Customizing Leaf Colours
Another particularly challenging aspect of the application was having a way for us to light the nanoleaves to any colours we wanted. As we wanted to create bespoke and diverse tree animations we wanted the nanoleaves to match in colour. The issue is that for the nanoleaves the only way to change there colours is to predefine the colours in a list and send them to the nanoleaf API.
This was a conflict of interest with how we wanted the application to perform. In no way did we want to manually write multiple animations for the leaves. My solution was an algorithm I created called “Nanoleaf Scraper”
Nanoleaf Pixel Scraper
My idea was to have the nanoleaves scrape pixels from custom videos we input. This way we could create these beautiful bespoke gradient videos. We could input these into the app. This means we could overlay this gradient over the tree via projection and have the nanoleaves light up with the same gradient. In theory, they should both match and look amazing.
For the nanoleaves to have this possible I needed to get the RGB value of the pixel at the given nanoleaf location in real life. To achieve this, I created the pixel scraping animation.
Above shows the typical gradient video that would be passed to the application. given a video such as above, I wanted to scrape the nanoleaf colours as the chosen location in the video above.
1 |
|
The above script is responsible for doing exactly what I want. The videos are passed to the script. From there the leaves locations are fetched in pixels. I am then converting each frame of the video to a texture, grabbing the pixel and string that in a file. Once all videos are complete I can point the leaves to read all the pixels in the files that are output and sync them with the tree gradient.
This meant I had now completed scraping the pixel data and displaying the leaves as the correct colours.
Output Of Leaf Colours:
As seen from the images above, the left gradient video roughly matches the nanoleaves in the actual installation.
Showcase:
Extra Information
Solarflare StudioLINK TO PROJECT WRITEUP: https://drive.google.com/file/d/1QUc5PsR7m_RMbc1YZI-grEKgD3dW_MFX/view?usp=sharing