Slide 1

Slide 1 text

Augmented Reality Pulkit Kumar @DroidPulkit Student / Researcher @ Lambton College

Slide 2

Slide 2 text

What is Augmented Reality? It adds digital elements in our world, with the help of camera of our smartphone.

Slide 3

Slide 3 text

Disclaimer This is just a fun game in no way, the author is affiliated to any political organization

Slide 4

Slide 4 text

Objective

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Requirements • Unity3D software • Unity Account (Optional) • Vuforia Developers account • Some Assets to download

Slide 7

Slide 7 text

Unity • It is a cross platform game engine • Download it from unity.com (Personal edition) • Create a new project name : ARDemo with 3D option selected

Slide 8

Slide 8 text

Setup • Select Layout -> Default from the top right corner to get the layout as below

Slide 9

Slide 9 text

Setup - 2 • Go to File -> Build Settings • Choose Android then switch platform

Slide 10

Slide 10 text

Setup - 3 • On Left side in the Hierarchy pane, right click on Main Camera and delete it • In that pane only Right Click and choose Vuforia -> ARCamera • Again Right Click and choose Vuforia -> Image. This will add a ImageTarget

Slide 11

Slide 11 text

Setup • Go to Edit -> Project Setting -> Player • On the right in the Player Settings, select Android, other settings and change the package name to com.ardemo • Scroll down and deselect Android TV compatibility.

Slide 12

Slide 12 text

Setup • Scroll further down and select XR Settings and select Vuforia Augmented Reality.

Slide 13

Slide 13 text

Setup • On the left side, select the ARCamera and it will open stuffs in Inspector window on the right. Click Open Vuforia Configration We need to add the Vuforia Licence Key


Slide 14

Slide 14 text

Vuforia Vuforia is an augmented reality software development kit for mobile devices that enables the creation of augmented reality applications

Slide 15

Slide 15 text

Vuforia Setup • Go to https://developer.vuforia.com/ and register and click on Develop -> Licence Manager. And we will click on Get Development Key. • We will write app name as ARDemo and create a key, open the app name, and copy paste the licence key to App Licence Key in Unity

Slide 16

Slide 16 text

Vuforia • Now we want to 3D object to be displayed on a surface right? So I choose a Dollar Bill. • Download a picture of dollar bill from google and go to the Target Manager in Vuforia’s website and add a database named DollarNoteDB of TYPE : Device

Slide 17

Slide 17 text

Vuforia • Now to add the note, we click on DollarNoteDB -> Add Target -> Single Image -> and upload the jpeg image of Dollar note. Enter width as 5, and name it as “Dollar”, then we add it.

Slide 18

Slide 18 text

Vuforia • Now we need to download the Database to be used in the unity project • So we click on Target Manager again, the select the database “DollarNoteDB” and click on Download Database (All)

Slide 19

Slide 19 text

Downloading Assets Now we need to download the Donald Trump Low Poly 3D Figure. All credit goes to Denny for making this possible by developing this 3D model
 We can download the model from the link below. https://bit.ly/2S6LTs2 * Unzip the assets

Slide 20

Slide 20 text

Importing Now let’s import. In Unity Click on Assets

Slide 21

Slide 21 text

Importing • Drag and Drop DollarNoteDB.unitypackage and LowPolyTrump Folder to the Assets and click on Import • This will bring the dollar note and the 3D model of the trump to the project

Slide 22

Slide 22 text

Setup 1) Now select ARCamera and Click Open Vuforia Configuration

Slide 23

Slide 23 text

Setup In Databases unselect all databases and select dollarNoteDB and click activate along with it

Slide 24

Slide 24 text

Setup • Click Image Target • In Inspector Pane, select 
 Type : Predefined
 Database : dollarNoteDB
 Image Target : dollar • Set value of Y in position as -30
 
 This will bring a dollar note in the scene screen

Slide 25

Slide 25 text

Now we need to add trump on top of the note So, we start by going to assets folder -> LowPolyTrump -> Anims -> Trump_lp_anim_iddle Setup

Slide 26

Slide 26 text

Setup Now we will drag and drop trump idle on the top of ImageTarget
 So now the Trump Anim is the child of ImageTarget

Slide 27

Slide 27 text

Setup Now click on trump idle from the Hierarchy view 
 Change value of Y in Rotation to 180
 and Change the Scale to 0.3

Slide 28

Slide 28 text

Setup All this leads to this

Slide 29

Slide 29 text

Time to build on Android • Click File -> Build Settings • Click Add Open Scenes • Enter main and save • Select Android from Platform • Make sure Build system is gradle

Slide 30

Slide 30 text

Installing • Click Build and Run • It will ask for name to save it, enter “main” • Then we have to select the Android SDK • Make sure to connect your phone to the machine and turn on usb debugging • Build and Enjoy

Slide 31

Slide 31 text

Questions?

Slide 32

Slide 32 text

Downloads The final code for this tutorial can be found at http://bit.ly/2AaFEfK APK to download to Android Phone http://bit.ly/2Kou5pK

Slide 33

Slide 33 text

Bonus I have added a script to make trump walk around with a joystick, you can download the project from the link below http://bit.ly/2Qf0PHk

Slide 34

Slide 34 text

Credits • This presentation is possible because of this author on YouTube. • Feel free to watch his Tutorial method also http://bit.ly/2Dz3oNE