Inspiration

Social media sites such as Facebook and Instagram are places that connects us all. Using this technology, we have the power to send messages of positivity to our friends, family, or even to strangers! I wanted to create an augmented reality filter that enhances this ability. To do so, I reminded myself of my favourite way to receive messages - a fortune cookie!

What it does

This filter places an augmented reality life-sized fortune cookie on a flat surface detected by the plane tracker in SparkAR. This cookie can be scaled up and rotated. When the effect opens, the fortune cookie does a short dance. When the user taps the screen, sparkles will fly from the cookie and it will open to reveal a message saying - [Try it to see what it says! You didn't think I'd tell you here, did you?]. The sparkles can easily be togged on/off by tapping the screen as well.

How I built it

I first modelled, rigged, textured, and animated the fortune cookie in Blender, and then exported it as an .fbx file into SparkAR. There, I added interactivity, such as the scaling and rotating, configured the dancing animation to play as soon as the effect opens, and configured the cracking open animation to play when the user taps. I also created a particle system for the sparkles, that scales and rotates with the cookie, and starts only when the cookie is cracked.

Challenges I ran into

The first challenge was learning how to export two separate animation sprites in an .fbx file from Blender, and then in SparkAR, have one play automatically (the dancing) and the other play only after the screen is tapped (the cracking). The tricky part was making sure that the cracking animation cannot start until both the user has tapped on the screen and the dancing animation had stopped. By default, both animations start playing at once, but only one is visible. By the time the user clicks to crack the cookie, the animation would be finished. I had to make sure to switch the animation controllers after the dancing animation was done, and only after this switch could the user tap to crack the cookie. This way, both animations can be viewed as intended.

Accomplishments that I'm proud of

I am proud of creating the particle system entirely in SparkAR, and having it adjust based on the scale and rotation of the fortune cookie. Learning SparkAR in under a week is a huge accomplishment, and I am very proud of being able to create complex things like interactive particle systems right away.

What I learned

I learned that with enough patience, learning anything is possible, and that I can use my prior knowledge (of Blender, animation, 3D modelling, etc) to enhance what I am currently learning (AR).

What's next for Fortune Cookie

This effect could be enhanced with custom text, so the user can make the fortune cookie say whatever they want, and send it to a friend!

Built With

Share this project:

Updates