Similar to project 1, this project is also about creating virtual images and projecting them into an augmented reality. However, instead of having our creating widgets and projecting them with our markers, we have instead created a virtual table-top playset and a life-size version of this playset. This playset should be a human figure of ourselves and an environment we would most likely be in. This project demonstrates the use of creating human models, using animations, virtual buttons, physics, lighting, and creating models of life-size scaling.
Overall, the main goal of this project is to work with AR technology to have it connect to our environment. We use physics and lighting, and we work on creating different scales of this playset to make this feel more realistic.
In our tabletop version playset, when you show the Mars marker, you should notice that my playset will appear on the right side of the marker. You can see that my avatar is sitting on a couch in a living room, and watching TV (Even though the screen is black, my background sound is basically my avatar changing TV channels).
You should also notice that is a virtual button that says "Talk" on the Mars marker. When you hover your finger and move it away from the button, my avatar will stand up from the couch, and say a voice line. After my avatar stops talking, he will automatically sit back down on the couch and go back to watching TV. You can also check to see if this works in the Unity console. It will say "Button Pressed" when you have your finger on the button, and "Button Released" after you move your finger away from the button.
You can press this virtual button multiple times and have my avatar say his voice line as much as you want! Just know that if you are pressing the button while the animation and voiceline is still going, it will automatically start the animation and voiceline from the beginning again.
You can also show the physics in this playset by holding left-mouse-click. This will start dropping red balls on top of the playset. You will see that the red balls will bounce off of all the objects in the playset such as the bookshelves, avatar, table, lamps, etc. We can also combine our Mars marker with our Drone marker.
For our drone marker, we were suppose to create a virtual model of our real tabletop into Unity and have physics work by having the red balls bounce on or roll off the tabletop. For my virtual model, I decided to model the top tabletop part of my desk instead of the lower tabletop part since I have my monitor, keyboard and mouse on there. Anyways, you can see that I modeled the tabletop from the middle image as best as I can with Unity3D components. When you show the drone marker on the webcam, it won't show the virtual tabletop like the middle image because it turns invisible when you press play. This is invisible to make it seem like the red balls are actually bouncing and rolling off your real tabletop.
When you combine these two markers, we should have physics working for both of them. We can see above, the third image with the Mars and Drone marker together, that the red balls are bouncing off the playset. We can also see that the balls bounce off the tabletop or roll off, even though this is hard to see with images. To get a better understanding of what is going on, watch the video below this section!
In our life-size version playset, you can deploy the playset into a smartphone, and have it show up in real life on the phone! When the application starts up on your phone, you have to find an empty ground surface somewhere, and tap on the phone where you want to place the playset. You can see from these images that the size of the playset is a whole lot bigger than the tabletop playset. You can see in the middle image the virtual bookshelf is about the same size as the real life garage door! By the way, since I had no space in my room, I decided to demonstrate my life-size playset outside, and it looks so cool!
Anyways, you can tap on other ground surfaces if you want to move the playset somewhere else, and it will move accordingly. This is pretty much all the lifesize version can do. It doesn't display physics or use a virtual button, but it looks really cool to see a life-size version of the playset instead of a tabletop! Check out how to use these programs in the instructions below!
Below is a short video demonstrating how this application works.
You can click the link on top of this page to take you to my GitHub project or click here. Click on Code and download the ZIP file from there. In order to run this project, you must have Unity Version 2019.4.1f1 and Vuforia Version 9.4.6 downloaded on your computer. You must also make sure you have iOS or Android build support installed with your Unity Version.
Need access to a webcam to work with the AR camera, and a smartphone to deploy the playset to your phone.
You must also have access to the Mars and Drone image markers in order to showcase the playset and table top surface, respectively. Here are the copies of the markers below if you want to print them out onto paper and then cut them out.
http://www.evl.uic.edu/aej/428/20files/4%20mars%20markers.png
http://www.evl.uic.edu/aej/428/20files/2%20more%20mars%20markers.png
In order to use this program, you must open the project on Unity and press Play from there. The reason why there isn't a built version for this project is because I am using the free Vuforia engine, and it doesn't allow for builds, so we are just going to use Unity to run the program.
There are two separate scenes for this project, TableTopSize and lifesize. Let's go over how to set up your TableTopSize scene first.
TableTopSize Scene:
You will being using the Mars and Drone markers for this scene. Similarly to project 1, you will place the markers together on a table, press Play on the top-middle of Unity, and show the markers on your webcam. The Mars marker will display our playset, while the Drone marker will display our tabletop. However, since my tabletop plane is invisible, it's difficult to tell if the webcam detected the Drone marker or not. To test if the webcam did detect the Drone marker, while scanning the Drone marker, you can hold left-mouse-click and red balls will start falling from the sky. If the red balls are bouncing or rolling off the screen, that means that the webcam did detect your Drone marker and the tabletop plane is actually there.
To test the virtual button on the Mars marker, while the playset is showing on the webcam, place your finger over the virtual button on the webcam, and then take your finger away. The animation and voice line of my avatar will trigger after you release your finger from the virtual button.
Both of these should be able to correctly work together and while you are holding the left-mouse-click, the physics should be working for both markers.
LifeSize Scene:
You should be able to locate the lifesize scene by clicking in Assets → Scenes → lifesize. You also need to be able to have a smartphone for this because this will not work on your webcam. Make sure you have your USB connected to your smartphone. Also, make sure you either have the Android or iOS build support for your Unity Version, depending on which phone you have.
For Android users, you click on File → Build Settings. Select Android for the Platform, and click "Switch Platforms". Afterwards, make sure that you have the lifesize scene checked at the top, and not the TableTopSize scene, or else you are building the wrong scene! Check where it says "Run Device" and that your phone is selected on there. After that, press "Build and Run" and give your apk file a name, and save. This should build the project, and automatically deploy it to your phone after it finishes building.
For iOS users, it is a similar process, but there is an extra step you would have to do to deploy the playset to your phone. Please refer to the professor's Week 2 Panopto video on Blackboard called "Week 2.6 Deploying to a SmartPhone". This video explains how to deploy a project to a phone for both iOS and Android!
After the application is deployed to your phone, when you start up the application, make sure to find a clear ground surface to place the playset or else it may look weird having virtual objects on real objects. Tap on your phone where you want to place the playset, and the playset should appear! Hopefully, you enjoyed using this application!
None of the models except my avatar are made by me. For a list of sources I used not made by me, click here.
NOTE: Our professor recently changed in his project requirements that we may use the Astronaut marker to showcase our playset instead of the Mars marker. However, I kept my image marker to be the Mars marker and he said this is okay! So make sure you use the Mars marker instead of the Astronaut one!