cpsc 599/601 easyar and assignment 1using unity3d and easyar (or another ar tool if you prefer),...
TRANSCRIPT
CPSC 599/601EasyAR and Assignment 1
Slides byJessi Stark
In case you forgot...
Jessi Stark
• Slack: Jessi
• Email: [email protected]
• Slides: jtstark.com/teaching
Today’s Agenda
• Video vs. optical AR devices
• Set up EasyAR accounts
• EasyAR demo• Build and run a sample program to see how it works
• EasyAR basics
• Trigger events
• Assignment 1 overview
Video see-through vs.optical see-through.
Types of AR devices
Video see-through Optical see-through
Types of AR devices
Video see-through Optical see-through
• Video + graphics combined into image
• Occlusion
• Mobile: very limited field of view
• HMD: decent field of view
• Graphics projected onto see-through surface
• No occlusion
• Limited field of view
Types of AR devices
Video see-through Optical see-through
• Video + graphics combined into image
• Occlusion
• Mobile: very limited field of view
• HMD: decent field of view
• Graphics projected onto see-through surface
• No occlusion
• Limited field of view
EasyAR.
EasyAR
• Makes AR development easy (mostly)
• Every project needs a licence key
• Luckily, keys are free when you make a free account
• Go here: https://www.easyar.com/
EasyAR SDK
• The EasyAR SDK should already be installed on the computers in this room (MS156)
• To install it on your own machine, get it from here:• https://www.easyar.com/view/download.html#download-nav2
• EasyAR SDK 2.3.0 Basic for Unity3D (unitypackage)
EasyAR demo.
Download and run sample EasyAR program
• Download sample .zip file• https://www.easyar.com/view/download.html#download-nav2
• Unzip
• Open HelloARMultiTarget-MultiTracker project in Unity
• Create a licence key
• Change build settings for Android deployment
• Change player settings for Android deployment
• Build and run!
Connect your Android device via USB and then…
Voila!
• You should now have a working AR demo app running on your device.
• It will stay there. You don’t need to re-deploy unless you make changes.
• This multi-tracker demo can track multiple image targetssimultaneously! :o
• To test it out, grab the image files from Assets -> StreamingAssetsinside the project folder.
Whoa! More samples!
• Check out the rest to see how they do similar things with QR codes, identical targets, video content, etc.
EasyAR basics.
Let’s make our own AR app.
• Import the EasyAR package
• Add an EasyAR prefab to the scene
• Make the background transparent
• Create ImageTrackers
• Create ImageTargets
• Attach objects to targets
Find the EasyAR Unity package
• On the lab computers, your package file should be here:• C:\CourseWare\EasyAR_SDK_2.3.0
• On your own machines, it will be wherever you put it (naturally).
Add an EasyAR prefab to the scene
• Drag “EasyAR_startup” into the scene.• There are other prefabs you can use in the “Composites” folder.
• The EasyAR prefabs contain a camera object, so remove the defaultMainCamera.
• Under RenderCamera:• Clear Flags: Solid Color
• Background: Black
• Under ARCamera:• World Center: First Target
• You can use other settings depending on your project
ImageTrackers
• To track multiple images, we should use multiple image trackers.• This will allow us to always keep track of multiple targets simultaneously.
• One tracker can detect multiple images simultaneously by changing theSimultaneous Target property, provided they are all in view. However, it will only track one image at a time.
• Assign a tracker to each image target
ImageTargets
• Images should be high contrast with a complex pattern in order to be easily recognized.
• We can turn images into materials by importing them into the project and dragging them onto the ImageTarget object.
• We will need to add a script that defines the behaviour the ImageTarget should have when it is loaded onto the ImageTracker.• http://jtstark.com/teaching/
• The ImageTarget needs to hold a reference to the appropriate ImageTracker.
Put 3D objects in the “real” world
• To attach 3D content to images in the real world, we simply need to add that object as a child of the target.
Ready to deploy!
• Set the player settings
• Set the build settings
• Plug in your device
• Build and Run
Time to catch our breath.Phew. That was a lot.
Assignment 1
Using Unity3D and EasyAR (or another AR tool if you prefer), create a simple augmented reality application.
• Download a character from the Asset Store. (Or, if you’re feeling ambitious, try creating your own!)
• Recognize elements of the physical environment in your application (this can be either image targets or the environment itself).
• Program your character to move between at least three points in the scene.
• Trigger an exciting event when the character reaches its final point!
A1 Skills
• By now, we should have most of the skills to complete assignment 1.• We know about the Asset Store (last week).
• We know how to recognize image targets.
• We know how to attach objects to the image targets.
• We know how to make some objects move (last week).
• Animations will help us move characters in a nicer way.
• Remember: the IsTrigger property of an object’s collider component will allow us to invoke our own scripts on the object.
Useful Links
• Unity tutorials: https://unity3d.com/learn/tutorials
• Unity API: https://docs.unity3d.com/ScriptReference/index.html
• Microsoft APIs: https://docs.microsoft.com/en-us/dotnet/api/
• EasyAR tips: https://www.easyar.com/doc_sdk/en/Getting-Started/Setting-up-EasyAR-Unity-SDK.html
Next time on CPSC Mixed Realities...Simple animations. Triggers. A1 partial walkthrough.