Creating A Space AR Poster With Unity
Creating A Space AR Poster With Unity
Years 9-10
Summary
In this lesson, students explore how to design and implement a simple Augmented Reality (AR)
poster experience using Unity 3D and Vuforia SDK for Unity 3D. This lesson is within the context of a
Space-themed example, however, it could be used for other contexts such as Biology, Geography,
Art or more.
Developer requirements
1. Unity 3D - This lesson is developed using Unity 3D (2018 4.9f1) although any new version
would work
2. Free account with Unity 3d (https://id.unity.com)
3. Vuforia SDK (V8.5.8) for Unity 3D
4. Free account with Vuforia developer (https://developer.vuforia.com)
Resources
1. Printed copy of an Image Target (a sample is included in the ‘Appendix’ of this lesson).
Download the image target used in this project from here - http://bit.ly/ARSpaceAstronaut
2. 3D object that you want to overlay image (Note: this lesson uses freely available 3D objects)
3. Computer to install Unity 3D (check ‘system requirements’ for development -
https://docs.unity3d.com/Manual/system-requirements.html)
4. iPad or a computer with a webcam (in-built or wired) to test AR poster
1
4. If you have completed the above steps, click New button to start developing this lesson
5. Provide a name for the project (e.g. AR_poster), select Template as 3D and choose a location
from the computer to store the project files and click Create project (Note: it might take a
while to import things needed for your project such as assets)
6. Please complete steps 2-4 in order to set up the environment for your Unity-AR project
7. Once these steps are completed, start ‘Step 5’ to start developing your AR project
2
Step 2: Vuforia SDK for Unity 3D
What is Vuforia?
Vuforia is an Augmented Reality (AR) Software Development Kit (SDK) for mobile devices that
facilitates the creation of AR applications. It uses Computer Vision technology to recognise and track
‘Image Targets’ in real-time. Vuforia is also used as a Mixed Reality (MR) application development
platform.
Vuforia uses Computer Vision technology to recognise image targets and overlays AR experience
(e.g. 3D objects, videos) on image targets.
If you need to learn more about Vuforia, please refer to the documentation
(https://docs.unity3d.com/Manual/vuforia-sdk-overview.html)
License key
1. You will need a free account with Vuforia developer (https://developer.vuforia.com). Click
Register and complete the required information.
2. You will also need to get a Vuforia development key to build and test your applications with
Unity using License Manager (https://developer.vuforia.com/vui/develop/licenses) and Get
Development Key function.
3. Add a random licence key name (e.g. space_vuf), ‘tick’ the agreement box and select
Confirm to get a free development key.
4. Now click the licence key and copy it to your application.
3
Vuforia provides free samples of Image Targets to reuse in your projects. You can download them
from here - https://assetstore.unity.com/packages/templates/packs/vuforia-core-samples-99026
Alternatively, you can access them within the Asset Store tab in Unity. Use the Search textbox to
find Vuforia Core Samples. You can add these samples to your asset store and Import them to the
project. If you are unsure about which assets to import, select All and click Import.
Step 4: 3D objects
1. When our camera recognises the image target, we want to overlay a 3D object over it.
2. If you want to add your own assets, you can create 3D models on your own or download
from the web (Note: 3D models that compatible with Unity can be found here -
https://docs.unity3d.com/Manual/3D-formats.html)
3. Below are some suggested websites to find good 3D models. Feel free to share new
suggestions with the CSER community (https://teachingai.blog/)
a. https://www.assetstore.unity3d.com/
b. https://free3d.com/
c. https://grabcad.com/
2. In the left panel (Hierarchy), delete the default Main Camera and Directional light objects.
To do this, right-click on each object and select Delete.
3. Once the existing objects are deleted, add ARCamera to the project by selecting
GameObject > Vuforia Engine > AR Camera (if you are prompted for anything, you will have
to authorise them all - e.g. importing additional assets).
4. You should see the AR Camera object added to the Hierarchy panel. Once you select AR
Camera, you should see the Inspector panel on the right hand side. This demonstrates the
configurations of the object.
5. Towards the bottom of the ‘Inspector’ section, you should see a button Open Vuforia Engine
Configuration that is disabled by default.
4
6. To enable it, go to Edit > Project Settings and click on the Player button.
7. In the XR Settings section (bottom), select the option Vuforia Augmented Reality Supported
(Click ‘accept’ if you were prompted for Vuforia Software Licence).
8. You can then close the Project Settings window and go back to the AR Camera’s
configurations window.
9. The Open Vuforia Configurations button should be enabled by now (click ‘AR camera’ to see
the ‘Inspector’ window).
10. You will need to have a webcam (either built-in or wired) configured for this project (Note: if
you do not have a webcam, alternative steps for testing are listed at the bottom of this
lesson). If you have only one camera associated with your PC or laptop, everything should be
working fine with the default settings. To confirm this, click Resources in the Assets tab and
select VuforiaConfiguration.asset.
5
11. In the Inspector window, check Webcam settings towards bottom. In the Camera Device,
select the webcam you want to use for this project. Otherwise, leave Integrated Webcam as
below.
12. To add an image target to our project, go to GameObject > Vuforia > Image. This will add
the image target to your scene
13. In the Image Target Behaviour component, click on the Database drop-down list and select
your Target database (e.g. VuforiaMars_Images). In the Image Target drop-down list, select
the name of your Image Target (e.g. Astronaut) from the database.
Note: You may have to zoom in a little bit inside your scene to see the image.
6
14. The default image comes from the Vuforia core samples we imported earlier. It can be
replaced later with your custom image, but for now, we want to check that our setup is
working.
15. Therefore, we use predefined as the Type of Image Target Behaviour. You can also define
custom image targets by changing the Type to User Defined (See optional steps at the end
of this lesson to add custom image targets).
16. Now we will need to add a 3D object to the Image Target. For this, right-click on the
ImageTarget in the left panel and select Vuforia > ModelTarget.
17. We have selected VuforiaMars_ModelTarget as the Database and the Model Target in this
project.
18. By default, the 3D model is quite big. Therefore, we need to scale it down. Click on the
ModelTarget object in the left panel and update its scale in the right panel. A scale X, Y and Z
of 0.5 should work well. After scaling it down, it should look something like below.
7
19. At this stage, we should test that our setup is working properly before starting to add our
own assets. In the Hierarchy window, make sure the Model Target is placed under the
Image Target (Note: You might want to change the position of the model, change the values
of the Scale / Rotation (inside the inspector) to get it into the right place)
2. Now you can try out the AR experience by clicking the Play button of Unity and pointing the
printed poster (or a mobile device loaded with the image target) to the camera.
We have included the Image Target used in this lesson at the end of this lesson (Appendix).
Alternatively, you can download and print them on your own using this link
(https://library.vuforia.com/content/dam/vuforia-library/docs/target_samples/unity/mars_t
arget_images.pdf)
8
3. If everything is working properly, a 3D model should appear when you point the image
target to the computer’s camera. To stop running the project, hold and press the Play button
again.
2. To test the project with iPad, we will have to switch platform to iOS. Select File -> Build
settings and then select iOS as the platform.
9
3. If you do not have iOS modules loaded (see pic above), click Open Download Page and you
will be prompted to Save iOS support file. Download this file to your local computer and
double click to install it (Note: this installation required ~2 GB of your disk space).
4. Once you have installed iOS support, make sure you restart Unity. Now go back to File ->
Build setting -> iOS (step 2 above) and click switch platform at the bottom and wait until
switching platform done.
5. If switching of platform is successful, you will see a window like below in Build settings.
10
6. Connect your iPad to the computer using a USB cable (provided for iPad charging) and open
Unity Remote 5 app. Once it is opened, click the Play button in the Unity window.
7. Click Edit -> Project Settings -> Editor and select the Device that is connected to Unity. You
will be prompted to select the iPad you are using (Note: iPad name should different from
what is shown in the image below)
8. You will see the Unity play screen duplicated in your iPad. Now point the printed poster in
front of your iPad camera and enjoy the AR experience with 3D models. Enjoy!
11
2. In the Vuforia Developer Portal (https://developer.vuforia.com/vui/develop/databases),
select Target manager.
3. Click Add database, provide a name, select type as Device and click Create.
4. Now select the database we have created (e.g. Space_posters) and click Add Target.
There should be four different target types. Select Single Image and browse your disk to
locate the image you want to use as an Image Target
5. The Width value (e.g. 5.5 in cm) is a scale value that you need to set to the size you want the
image to appear in your Unity Scene (Note: Unity measures everything in your Scene in
relation to the size of your Image Target).
6. Give a name to the target and upload it
7. Now the uploaded image appears in the list of targets with a rating. If the image you
uploaded has low ratings, it may be difficult for the camera to track it (see more information
here -
https://library.vuforia.com/articles/Solution/Optimizing-Target-Detection-and-Tracking-Stab
ility). In such cases, try to upload a different image.
8. Once you are satisfied with your image’s rating, check the box next to Target Name and click
Download Database button.
12
9. Under the development platform, select Unity Editor and click Download and save this file
(.unitypackage) in your disk.
10. Switch back to your Unity project to use the Unity package in your AR application.
11. Now, we need to import Image Target that we have saved. In the Project window, right click
Assets and select Import Package > Custom Package and select the package saved in the
disk before.
12. Add you App Licence Key saved from V uforia Licence Manager.
13. Once you have set the image target, next step is to add image target to the scene by
selecting GameObject > Vuforia > Image and follow the instructions listed in Step 5: AR
development using Unity.
Discussion
The following are some suggested discussion points to create the augmented world with astronaut
poster. You can add answers to following questions as audios, new 3D models, videos, or new Image
Targets.
● How many astronauts can live on the International Space Station at once?
● What was the first mission to successfully land on the Moon? Who involved? When was it?
● Which NASA space shuttle exploded 73 seconds into its flight? What was the reason? And
which astronauts on board sacrificed their lives?
● Why 2019 October is important for female astronauts? What it means by ‘All-Female
SpaceWalk’? Who involved? (See more information here -
https://www.space.com/first-all-female-spacewalk-date-moved-up.html)
● How does the computer/device recognise the Target image?
In this activity, students are engaged in evaluating the AR posters and considering how they could
build their own AR/VR experience about astronauts. In doing so they are thinking about the digital
content and ways of presenting information in a 3D space.
Assessment
[We have suggested Assessments, however, you may choose to use your own or for further advice,
examples and support around assessment please visit the Digital Technologies Hub at
digitaltechnologieshub.edu.au/teachers/assessment]
A group activity to add more information to the AR space poster as audio and/or 3D text about
astronauts and spacecrafts would be an excellent chance for students to present their AR project to
the class, along with addressing:
13
● Project description (Artificial Intelligence) - what Artificial Intelligence concepts (e.g.
computer vision to track target image) are coupled with this project. This is an optional
activity for students familiar with AI technology. For more information, please visit our free
CSER MOOCS on teaching AI in Secondary years
(https://csermoocs.appspot.com/ai_secondary)
● Project description (Augmented Reality) - what AR concepts (e.g. image target, 3D objects)
are coupled with this project
● Process of design and development of the project
● What is the experience of developing this AR project, what are the identified challenges and
how they were resolved
Curriculum links
Links with the Digital Technologies curriculum area
Strand Content
Year band description
Years 9-10 Processes and Create interactive solutions for
Production Skills sharing ideas and information
online, taking into account
safety, social contexts and legal
responsibilities (ACTDIP043)
Plan and manage projects using
an iterative and collaborative
approach, identifying risks and
considering safety and
sustainability (ACTDIP044)
Learning Content
Year band area description
Year 9 Science - Science Inquiry Communicate scientific ideas
Skills and information for a particular
purpose, including constructing
evidence-based arguments and
using appropriate scientific
language, conventions and
representations (ACSIS174)
Year 10 Science - Science Inquiry Communicate scientific ideas
Skills and information for a particular
purpose, including constructing
evidence-based arguments and
using appropriate scientific
language, conventions and
representations (ACSIS208)
14
Author: Thushari Atapattu
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0
International License. Computer Science Education Research (CSER) Group, The University
of Adelaide.
Appendix
15
16