Skip to content

Preparing the Development Environment

Rafael Silva edited this page Jan 22, 2014 · 3 revisions

The main platform used in this project is an IDE called Unity3d. It is very popular in game development for providing a set of tools that allows developers to quickly deploy virtual environments. In our case we will use Unity3d to model the virtual building and other objecs that will interact with the user. Besides the fact of Unity3d be one of the best IDE for this type of development, it's cross platform and multiportable; which means that can be developed in different Operational Systems (Windows, Mac, Linux,...) and run in several different devices (Android, iOS, webBrowser, Xbox, Wii...). You can have a better overview about it here:

Therefore, the first step in preparing the development environment is to download and install Unity3D. We are using few components that requires a specific version of Unity (4.1 and below). You can find the right version here: Mac: http://download.unity3d.com/download_unity/unity-4.1.0.dmg Windows: http://download.unity3d.com/download_unity/UnitySetup-4.1.0.exe

here are some links with usefull information about unity: http://unity3d.com/learn/tutorials/modules/beginner/editor http://docs.unity3d.com/Documentation/Manual/UnityBasics.html

On the top of Unity 3D we will be using an SDK to handle the Augmented Reallity features, called Vuforia. It will basically replace the ordinary Camera Object with a special type of Camera Object that will allows us to project Virtual Objects (the Building) in images from the real world collected by a Real Camera. This is another advanced concept that involves a lot of Math and heavy coding that we have a wonderful piece of software to deal with. Once more, we just need to understand how to use it. You do not need to install the Vuforia SDK, because it's libraries are integraded with this repository. The next session will discuss about how to use it, but it's good to check some references to get used to it.

Take a look at the Developers web site and check what we can archive using Vuforia: https://www.vuforia.com/platform

After you have Unity3d installed and you are familiar with it's interface is time to download the project source files.

You can download the files directly on the address: https://github.com/Compy/buildingterry/archive/master.zip

Or you can clone/fork the project using git: https://github.com/Compy/buildingterry.git

If you download the zipped file, extract it. If you have it cloned, just keep track of the folder location.

##Printing the Target Image For this first Example, you will need to print the following image that will be used as the target to place the virtual object:

https://developer.vuforia.com/sites/default/files/sample-apps/targets/wood.pdf You can print it in "black and white" if you preffer.

Android Users

You will need to download and install the AndroidSDK. If you already have it installed, make sure you have the path to it. Otherwise, download the latest version and have it available to the next steps: https://developer.android.com/sdk/index.html#download

iOS Users

If you are running an Mac, you already have the Xcode installed. Just make sure you are running the latest update of it. If you are a PC user, but would like to run this app in a iOS device (iphone, iPad,...) will need to install Xcode: https://itunes.apple.com/us/app/xcode/

How to Use

To open the project files, go to Unity3d, click on File -> Open Project. It will launch the Project Wizard, where you can click on the "Open Other..." button and select a folder called "First Example" (../buildingterry-master/Unity/First Example) You will noticed that Unity will load few Assets and will open the a Scene Called "Vuforia-VirtualButtons". This is the first scenario we have deployed, but this document will be updated once we have more Scenes available.

Now that you are familiar with Unity, you realize that by clicking in "play" you should see the app running. However, if you are running on free license, you will not have access to a physical camera until you had the scene built. If you want to see some action, go ahead and follow the steps bellow to run the app in your device.

Building and Run

note: make sure you have your device plugged on the computer.

Because our focus will be on mobile devices, this session will focus on how to run the app in the main mobile devices (Android and iOS).

The beginning of this process is very similar: On Unity, you need to click on File-> Building Settings. On the Building Settings Window, you have to make sure the current scene is checked (Vuforia-VirtualButtons.unity in our case) and right Platform is selected (Android or iOS). After had selected the right parameters you can click on "Build and Run". Independent the platform you choose, after hit tell the IDE to Build the app, it will ask you where to save the built app. This step is not really relevant, but would be good you define a pattern for not have files all over the place.

Android

When the IDE finish to build the new app it will ask you to point the Android SDK folder. There is no much complexibility here and basically everything will be done behind the scenes for you by the SDK. At this point the application should be running in your android device.

iOS

If you choose iOS, the system will open Xcode and it should finish to load the app in your device. Should be very straight forward if you are running the latest version, however I had problems liking some libraries. If that happens, go you will need to follow the steps below to fix the PATH:

To change this setting in Xcode 4.5, click on the project in the Project Navigator (left pane, first tab) > Project - Unity-iPhone > Build Settings > Header Search Paths. Use the search bar in Build Settings to find the Header Search Paths.

source: http://answers.unity3d.com/questions/184650/qcar-build-fail.html

Clone this wiki locally