multimedia project

20
1 Multimedia Project: Make an Animated AR Object Using Vuforia and Unity3D - Project Report - Author: Reynaldi

Upload: reynaldi-somantri

Post on 29-Jan-2016

13 views

Category:

Documents


2 download

DESCRIPTION

Project Report Designing MUltimedia System Application

TRANSCRIPT

Page 1: Multimedia Project

1

Multimedia Project:

Make an Animated AR

Object Using Vuforia and

Unity3D

- Project Report -

Author:

Reynaldi

Page 2: Multimedia Project

2

December 2015

Table of ContentsAugmented Reality........................................................................................2

Unity..............................................................................................................3

Vuforia...........................................................................................................3

Image Target.................................................................................................3

Object Target.................................................................................................4

Vuforia Object Scanner..................................................................................5

3D Model.......................................................................................................5

Digimon.........................................................................................................7

Digivice..........................................................................................................7

Required Program..........................................................................................7

Collecting Dataset.........................................................................................8

Showing the Model......................................................................................10

Result..........................................................................................................12

Implementing the moving character with another model...........................13

Conclusion and Lesson Learned..................................................................16

Augmented Reality

Augmented reality (AR) is the integration of digital information with live

video or the user's environment in real time. Basically, AR takes an existing

picture and blends new information into it. One of the first commercial

applications of AR technology is the yellow first down line in televised

football games.

The key to augmented reality is the software. Augmented reality programs

are written in special 3D augmented reality programs such as D'Fusion,

Page 3: Multimedia Project

3

Unifye Viewer or FLARToolKit. These programs allow the developer to tie

animation or contextual digital information in the computer program to an

augmented reality "marker" in the real world.

The end user must download a software application (app) or browser plug-

in in order to experience augmented reality. Most AR applications are built

in Flash or Shockwave and require a webcam program to deliver the

information in the marker to the computer. The marker, which is sometimes

called a target, might be a barcode or simple series of geometric shapes.

When the computer's AR app or browser plug-in receives the digital

information contained in the marker, it begins to execute the code for the

augmented reality program.

AR applications for smartphones include global positioning system (GPS) to

pinpoint the user's location and its compass to detect device orientation.

Sophisticated AR programs used by the military for training may include

machine vision, object recognition and gesture recognition technologies.

Unity

Unity is a flexible and powerful development platform for creating

multiplatform 3D and 2D games and interactive experiences. It's a

complete ecosystem for anyone who aims to build a business on creating

high-end content and connecting to their most loyal and enthusiastic

players and customers.

Vuforia

Vuforia is an Augmented Reality Software Development Kit (SDK) for mobile

devices that enables the creation of Augmented Reality applications. It uses

Computer Vision technology to recognize and track planar images (Image

Targets) and simple 3D objects, such as boxes, in real-time.

Image Target

Image Targets represent images that the Vuforia SDK can detect and track.

Unlike traditional fiducial markers, data matrix codes and QR codes, Image

Targets do not need special black and white regions or codes to be

recognized. The SDK detects and tracks the features that are naturally

Page 4: Multimedia Project

4

found in the image itself by comparing these natural features against a

known target resource database. Once the Image Target is detected, the

SDK will track the image as long as it is at least partially in the camera’s

field of view.

Image Target also known as image Marker.

Object Target

Object Recognition allows you to detect and track intricate 3D objects. It

has been designed to work with toys (such as action figures and vehicles)

and other consumer products.

Object Recognition can be used to build rich and interactive experiences

with 3D objects. These experiences could be augmenting a toy with 3D

content in order to bring it to life, overlaying a user manual on top of a

consumer electronics device or leading a new employee through an

interactive training process for a workplace device. Another simple

application of Object Recognition is to unlock new in app content when a

product is recognized.

Object Targets vs Image based targets

Object Targets are a digital representation of the features and geometry of

a physical object. They are distinct from image based target types, such as

Image Target, Multi Targets and Cylinder Targets that require the use of a

planar source image. An Object Target is created by scanning a physical

object using the Vuforia Object Scanner.

Target Type Target

Source Recommended Uses

Image based

targets

planar

images

publications, packaging, flat

surfaces

Object Targets feature

scan

Toys, products, complex

geometries

Page 5: Multimedia Project

5

Vuforia Object Scanner

The Vuforia Object Scanner is an app that allows you to scan and create

object targets. The Object Scanner produces an Object Data (*.OD) file that

includes the source data required to define an Object Target in the Target

Manager. The Object Scanner enables you to generate, test and edit OD

files. It provides a visualization of the object’s features as well as their

coverage across the object.

3D Model

3D models represent a physical body using a collection of points in 3D

space, connected by various geometric entities such as triangles, lines,

curved surfaces, etc. Being a collection of data (points and other

information), 3D models can be created by hand, algorithmically

(procedural modeling), or scanned.

3D models are widely used anywhere in 3D graphics. Actually, their use

predates the widespread use of 3D graphics on personal computers. Many

computer games used pre-rendered images of 3D models as sprites before

computers could render them in real-time.

Today, 3D models are used in a wide variety of fields. The medical industry

uses detailed models of organs; these may be created with multiple 2-D

image slices from an MRI or CT scan. The movie industry uses them as

characters and objects for animated and real-life motion pictures. The video

game industry uses them as assets for computer and video games. The

science sector uses them as highly detailed models of chemical

compounds. The architecture industry uses them to demonstrate proposed

buildings and landscapes through Software Architectural Models. The

engineering community uses them as designs of new devices, vehicles and

structures as well as a host of other uses. In recent decades the earth

science community has started to construct 3D geological models as a

standard practice. 3D models can also be the basis for physical devices that

are built with 3D printers or CNC machines.

Page 6: Multimedia Project

6

Page 7: Multimedia Project

7

Digimon

Digimon (デジモン Dejimon, branded as Digimon: Digital Monsters, stylized

as DIGIMON), short for "Digital Monsters" ( デ ジ タ ル モ ン ス タ ー Dejitaru

Monsutā), is a Japanese media franchise encompassing virtual pet toys,

anime, manga, video games, films and a trading card game. The franchise

focuses on Digimon creatures, which are monsters living in a "Digital

World", a parallel universe that originated from Earth's various

communication networks. In many incarnations, Digimon are raised by

humans called "Digidestined" or "Tamers", and they team up to defeat evil

Digimon and human villains who are trying to destroy the fabric of the

Digital world.

Digivice

The Digivice (デジヴァイス Dejivaisu?), short for "Digital Device" is a device

from the Digimon series based on the first Digimon product, the Digimon

virtual pet, and it indicates that the possessor is a DigiDestined. It appears

in every season of the anime, as well as the V-Tamer 01, Chronicle, D-

Cyber, and Next manga, and several of the video games. Its primary use is

to empower the DigiDestined's partner Digimon through Digivolution,

though each version of the Digivice is also equipped with many other

helpful features, such as radar or data storage. Even when Digivice's are

the same type, they are usually differentiated by a color scheme unique to

the character who uses them.

Required Program

To do this project there were some program required. The minimum

requirement is:

1. Unity 5.2.2f1 (32-bit)

2. Vuforia-unity-5-6-0

The unity we are using is the 32 bit version. Because the 64 bit is not

compatible with Vuforia SDK that we are going to use.

The Unity for Windows itself can be obtained in

https://unity3d.com/get-unity/download . This is an online installer. So you will

need a quite fast internet connection and it better if you have visual studio

installed to edit the C# command in unity platform.

Page 8: Multimedia Project

8

Downloading and Installing Vuforia that can be obtained at. The author

download for unity https://developer.vuforia.com/downloads/sdk

Collecting Dataset

Like mentioned before, to do Object Recognition as one of the Goal of this

project, we need to collect some dataset as our Object Targets. This will be

done using the Vuforia Object Scanner. We are using some of the Digimon’s

Digivice as our Object Target because we are trying to create some

Digimon AR based on author favorite’s anime franchise.

There are 4 Steps to create an Object Data file by scanning an object.

1. Print the Object Scanning Target

2. Place the printed target

3. Position the object

4. Scan the object

Before you begin scanning objects, you’ll need to print out the Object

Scanning target. Be sure to print the target at its native size (100%).

Modifying the target size will affect physical scale estimated by the Object

Scanner.

 

 

The Object Scanning Target is used to establish the position of your Object

Target relative to its local origin. This origin is represented by ( 0,0,0 ) in

Page 9: Multimedia Project

9

the lower left hand corner of the Object Scanning Target's grid region and

corresponds to the local (0,0,0) of the Object Target prefab instance's

bounding box. The unit scale of the grid is in millimeters, this unit is also

used for the scene unit and the estimated physical object scale. 

The Object we intend to scan need to be put in the white box over the grid

on the top of the left of the Paper like the picture below.

We need to place object at the origin 0, 0, 0 and need to cover all side of

the object. As the example, when it only scanned the surface the object like

Figure 1 it will not coverage all the point.

Page 10: Multimedia Project

10

Figure 1

After that we can check the coverage of the object. We need to not move

the object while scanning, and after the dataset is complete we upload the

*od file to the Vuforia Website.

Showing the Model

To show the model first we need to download the object dataset that we

scanned earlier from vuforia website. Then after that, we also need to

Page 11: Multimedia Project

11

generate our API Key to be implemented on AR Camera Object in Unity

Scene. Then we can import both of vuforia unity package and our dataset

unity package into the unity project.

After importing the unity package, drag the AR Camera from Vuforia Assets

to the Unity Scene, and insert the API kEY and connect it to the dataset.

Like the picture below.

Then we drag the object target from vuforia assets to unity scen and put or

3d model in it under the hierarchy. For the 3d model the author is using the

3d model of alphamon taken from

http://www.models-resource.com/pc_computer/digimonmasters/model/7149

/

Page 12: Multimedia Project

12

Then don’t forget to add some component to the 3D Model such as Box

Collider, Mesh Renderer, and Cube (Mesh Filer). These components are the

foundation of the 3D Model so it can stand on the object target. It will also

enable the augmentation on the other side like rear side of the object

target when we rotate it.

Then we can build and run by pressing ctrl+shift+B and choosing android

as the platform, because we want to deploy it as android mobile apps. In

the player settings configuration, don’t forget to change the product name

into the one you desired. And the bundle identification need to follow the

following rule: com.companyname.productname. With the version, bundle

version and minimum API level set we are ready to go. The application will

be exported as *.apk and we can install it through the android debug

bridge.

Result

As the result, the Alphamon 3D Model will be augmented on the DIgivice

Object Target as below:

Page 13: Multimedia Project

13

Page 14: Multimedia Project

14

With the right angle, correct lighting and steady hand the augmentation will

easily be shown. These parameters should be fulfilled for the augmentation

to happen and it becomes some weakness of this application.

Implementing the moving character with another model

The problem with current model is the model we used is too rigid. So we

are trying to make the model move or we can say the authors try to

animate it by using another model. With some guidance from

http://www.himix.lt/augmented-reality/augmented-reality-animated-

character-model/ we are replacing our model and try to implement it on

Image Target first, not the Object Target.

As we can see from the screenshot above the 3D model have the Animator

Component with some Controller called ChuckFight1.

The difference from previous model is in the ChuckFight1 there are already

embedded moving behavior method such as below

Page 15: Multimedia Project

15

So what we need is just scaling the abject and creating the movement as

you can see in the screenshots below.

Page 16: Multimedia Project

16

And finally here is the final result. We managed to successfully show the

object on the markered paper

Page 17: Multimedia Project

17

Conclusion and Lesson Learned

In the end, AR application is crated and object Recognition is achieved.

Even the animated object is still implemented on image target not object

target, it can easily studied and implemented on Object Target. However

there is still some parameter to be fulfilled when we want the augmentation

to be appeared.

There are some lessons can be learned like, using Unity to create game and

animation. Despite using Library like Vuforia, Author can understand the

basic how Augmented Reality Work. Object Recognition is also can be

achieved using Vuforia Object Scanner. Unfortunately the Vuforia Object

Scanner only compatible and giving the best result using Samsung Galaxy

S5 and/or Google Nexus 5.

Augmented Reality is still a hot topic and need to be explored more. This

project is also fun because it is based on the author’s fanciness of Digimon

and fulfilling the dream of creating Digimon AR.

For the future work developer can develop a lot more AR games like AR

TCG (Trading Card Games) that will augment the model and showing some

fighting animation. It will be very cool as hell!!!