The video unity to metaio
This video covers basic tracking, animation and GUI, and simple movement.
https://www.youtube.com/watch?v=dkww9vDOyTM&index=3&list=UUlrczoVF7RBBJc2MQaJreDw
Also download the unitypackage for the video. here is the dropbox link
https://www.dropbox.com/s/fgd784ejjnhd36i/AR_CLASS.unitypackage?dl=0
For windows users, please setup the environment. Here is metaios the tutorial:
http://dev.metaio.com/sdk/getting-started/unity3d/setting-up-the-development-environment/
Configuration
of Unity Editor on Windows
The
Metaio SDK requires OpenGL to render the camera image, but Unity
defaults to using DirectX on Windows. You have to change this by
right-clicking your shortcut to Unity (on your desktop or in the
start menu) and opening its Properties.
Then add the parameter -force-opengl after
the command line that ends with "Unity.exe", e.g. like so:
1.
dev.metaio.com
login
- Download
the Metaio SDK -
once
downloaded – double click
3.
on the same webpage > top menu bar
my
apps
Name
it under
App
registration
App
name
App
identifier
4.once
u have named it
you
can click it which will give u the signature-
copy
it
------------------------
Unity
5.
Open Unity-
6.
Create a new project
7.
In the projects window- right click on assets
and
choose to
Import
package- custom package
find
the package you downloaded
find
the _Unity folder inside
inside
that select the
"metaioSDK_unitypackage"
to upload
3:00
mins
------------------------
8.
next - import again
right
click on assets/ Import package - custom package
"Character
Controller"
------------------------
9.
next - import again
right
click on assets
and
choose to
Import
package - custom package
Get
this from the dropbox
"AR_Class_Unitypackage"
------------------------
test
it-
10.
in the assets/ AR_Class/ example1/ scenes
example1
<--- click on it
the
example1 scene will load
test
it by pressing the
play
button
and
holding the metaio man marker in front of your webcam.
------------------------
Delete
everything form the old scene
----------------------
11.
in assets/ metaio/ prefab / metaioSDK
load
it
Delete
the main camera
----------------------
12.
[with metaio sdk selected]
in
the inspector
SDK
Signature- copy paste it into the signature field.
select
source- choose streaming assets
----------------------
13.
find the tracking data file
assets/streamassets/
tracking data
under
tracking data
open
tracking data
its
an xml file
find
the reference imgae [line 117]
<referenceimgae>target.png</ReferenceImage>
****If
you want to replace the trackign image you must update the xml file.
in this case
replace
"target.png"
metaio sdk selected
add the trackign config file- [under streaming assets]
click on the circle next to the field
14.
now in the
Metaio/
prefabs/ metaioTracker
drag
the metaioTracker in the hierarchy under the
Metaio
SDK
The
metaioTracker is a virtual component of for the tracking image.
everything
under the metaioTracker in the hierarchy will be
rendered when tracking.
----------------------
15.
add 3d content
assest/ar_class/resources/prefab/
unity worker
drag
the unity worker under the metaioTracker
16.
add a light
------------------------
------------------------
now
try example 2 buttons
1.
open exapmle 2-
launch
the project
2.
with the unity worker selected - in the inspector
you
will need to add animation.
go
to
"add
component"
type
"animation"
open
the animation tab
size
= 4
------------------------
3.
now 4 element fields will appear
click
on the camera next to them and navigate to the individual animations-
you
have to connect these to the animation loops- dont thru a pop up
window
------------------------
4.
Again
under
animation go to
"add
component"
add
the
"AnimationManager"
script - premade
[take
a look and open the script]
this
contains the 4 buttons
each
button will control an animation.
------------------------
Example
3
walk
around
1.
same scene as 2
but
[with
unity worker still selected inthe inspector]
when
adding animation
add
only 2 for size
for
the elements add
element
0 = idle
element
1 = walk
-----
under
character behavior (script)
in
the script field add-
"CharacterBehavior"