Monday, 28 March 2016

Unity: Exporting for App development

Export and Xcode Build settings changes 
Android studio:http://www.wikitude.com/developer/documentation/unity#_48_INSTANCE_Zk7M2pQVPDDi_=setupguideunity.html

Once the application is setup in Unity and ready for testing on a real device, it needs to be exported as an Xcode project for iOS or built for Android either directly by creating an .apk file using Unity or by exporting an Android Studio project. (3)

(3)This method follows the instructions outlined on the wikitude documentation page: http://www.wikitude.com/developer/documentation/unity#_48_INSTANCE_Zk7M2pQVPDDi_=setupguideunity.html

Unity: Scripting and Geocaching

I started familiarising myself with the Unity interface and tutorials. I particularly found the tutorial Unity Scripting extremely helpful in implementing the Geocaching for the AR.

using UnityEngine;
using System.Collections;
public class Gps : MonoBehaviour {
 // Use this for initialization the geolocation/location based information
 IEnumerator Start () {
   // First, check if user has location service enabled
   if (!Input.location.isEnabledByUser)
   {
     // remind user to enable GPS
     // As far as I know, there is no way to forward user to GPS setting menu in Unity
   }
   // Start service before querying location
   Input.location.Start();
   // Wait until service initializes
   int maxWait = 20;
   while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0) {
     yield return new WaitForSeconds(1);
     maxWait--;
   }
   // Service didn't initialize in 20 seconds
   if (maxWait < 1) {
     print("Timed out");
   }
   // Connection has failed
   if (Input.location.status == LocationServiceStatus.Failed) {
     print("Unable to determine device location");
   }
   // Access granted and location value could be retrieved
   else
     print("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " +    Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " +  Input.location.lastData.timestamp);
  // Stop service if there is no need to query location updates continuously
  Input.location.Stop();
 }
}

Unity: AR Getting started

Simple augmented reality Test

1. Import the Wikitude.unitypackage into your project


Select the downloaded Wikitude.unitypackage in the presented open file browser and click open. You should import all items that are part of the Wikitude.unitypackage.

2. Add the WikitudeCamera and ClientTracker or CloudTracker prefab to the Unity scene hierarchy
3. Add a custom augmentation to the tracker and handle OnEnterFieldOfVision

andOnExitFieldOfVision events
4. Export your project and change Xcode Build Settings in order to fully integrate the Wikitude Native SDK in your Unity project (1).

Sunday, 27 March 2016

AR Plugin for Unity: installation Wikitude AR Plugin

Your have two options for the part of the project, either create your own or host the augmented reality on an existing cross-platform app.
If you are going to create your own I recommend visual studio. You can download the program via https://www.visualstudio.com/post-download-vs?sku=community&clcid=0x409#

I have chosen to go with hosting the augmented reality on an existing program, I have chosen to go with Unity augmented reality using a free cross-platform Wikitude plugin.

Reason

I have chosen to use wikitude because it allows the user to host easy location-based augmented reality and its free, easy to use and relatively straightforward. You can download the full Wikitude augmented reality product which does not require any Unity work, however its gonna cost an arm and a legg (nearly 1400 euros)
if you want a pretty comprehensive list of possible AR products you could use to do the job, check out: http://augmera.com/?p=461

Installation

1. Download the plugin http://www.wikitude.com/download/#DownloadExtension
the download should take 8-10 minutes depending on your network.
2. After your download has begun, you will need to register an account with wikitude to get a free activation key, they key will be sent to the email you provide.
3. Open the file and extract its content and install the package. Rememeber where you saved the extracted file.
4. Open Unity and open a new project
5. Assets > Import package > custom packages
6. Browse to where you have saved the extracted file > Unity-Wikitude_1.2.1-1.1.0_2016_03_21_16_40_46 > packages > Wikitude
7. The file should start unpacking itself into Unity. A box should appear outlining all the wikitude elements. Click 'Import'.
8. Close Unity and restart your computer.
9. Open Unity and click on the wikitude folder within the Assets folder
10. To use the Wikitude Unity Plugin with a certain license key, paste your license key into the text field of the WikitudeCamera prefab.


Follow this post for full details: https://www.wikitude.com/external/doc/documentation/5.1/unity/clientrecognitionnative.html

Unity: Importing objects

Import objects from modelling softwares.
supported formats: Sketchup,

Three methods
1. Drag and drop the file into the Project window
2. ‘Import New Asset…’ via Project window’s context menu
3. Click on Assets -> Import New Asset.. from the menu bar

 Refer to this UNITY website for further details: http://docs.unity3d.com/Manual/HOWTO-ImportObjectSketchUp.html

Limitations
GIF textures are not supported
Lines are not imported
2D components (Text, dimensions) are not supported
Dynamic components are not supported
Attributes are not imported into Unity
SketchUp Layers are not imported
SketchUp Shadow settings are not imported
SketchUp Drawing Styles are not imported
SketchUp Section Planes are not imported
SketchUp Animation settings are not imported
Limited SketchUp Scenes data are imported

follow this link for a complete bio of component based thinking within UNITY if your unsure or new to the concept: http://gamedevelopment.tutsplus.com/articles/unity-thinking-with-components--gamedev-12492

Inspiration: CacheTown

For the vivid project, the aim is to create a sort of 'discovery' augmented reality program to be viewed and explored by vivid patrons. The example done by Cachetown is the idea for what our team hopes to accomplish.

Cachetown

http://venturebeat.com/2012/10/02/cachetown-wants-to-bring-mobile-advertising-to-the-third-dimension-with-gamification-augmented-reality/
Check out their video for details of our inspiration.



Video accessed: https://www.youtube.com/watch?v=dHD6Z2eDZ-E 28th/03/2016 time: 5:08pm




Video accessed: https://www.youtube.com/watch?v=Go9rf9GmYpM 29th/03/2016 time 2:30pm

Thursday, 24 March 2016

Technology List: Complete list of software platforms used during the project

A Technology review was necessary to determine what program would be appropriate for the project. The criteria's include a SDK budget between $400-$1000, allow users to view augmented animations/videos via their Android or iOS based smartphones, and be Geo-location based(not symbol stimulated). The program should also be user friendly and allow for development and changes to SDK scripting.

Unity - game engine
Unity provides a range of services to help developers make games and engage, retain and monetize users within a free development platform.
Download
https://unity3d.com/get-unity/download?ref=personal
Gelocation formatting
 https://northrush.wordpress.com/2014/01/13/access-gps-data-on-unity-3d/
Understanding Components
http://gamedevelopment.tutsplus.com/articles/unity-thinking-with-components--gamedev-12492
Augmented Reality Plugin

Wikitude AR location-based cross-platform plugin for Unity
While the wikitude standalone platform for location-based augmented reality an expensive piece of software, they do have a free cross-platform plugin for unity for the augmented reality.
A further blog will appear outlining its installation and implmentation. For now, just read about the product here: http://www.wikitude.com/

App development: Android studio / cross platform: 
http://www.wikitude.com/developer/documentation/unity#_48_INSTANCE_Zk7M2pQVPDDi_=setupguideunity.html