The UBIK root folder contains a child folder, named ARConfig
The ARConfig contains two child folders named IDMarker and Markerless
IDMarker folder contains the resources and configuration files needed for scanning an id marker
Markerless folder contains the resources and configuration files needed for scanning a picture
IDMarker and Markerless folder contain a res and a conf folder
The res folder contains all the resources to be shown, like 3D objects, videos and links to UBIK® objects
The conf folder contains all the configuration files
The following shows an exemplary sketch of the folder structure:
/UBIK/ARConfig/
IDMarker
conf
TrackingData_Marker.xml
Action_Mapping.xml
res
.obj
.png
.jpg
.mtl
.3g2
.md2
Markerless
conf
TrackingData_Game.xml
Action_Mapping.xml
res
.obj
.png
.jpg
.mtl
.3g2
.md2
A senseful configuration always consists of a tracking configuration (in one of the TrackingData.xml) and a corresponding action configuration (in the parallel ActionMapping.xml). So when the pattern configured in tracking is recognized by the camera, the configured action is triggered.
Tracking Setup
The first step is to configure the tracking data xml in order for UBIK® to recognize scanned pictures and ID's.
In case the marker is a picture (image), the location of the pictures must also be provided. In the example it's ../res/pic_name.(png, jpeg).
The id located in the tracking data xml should be the same as the order of the id in the list of ids.
This example below the configuration of the location of the image:
The ID must be an integer number and it is not allowed to leave gaps, otherwise tracking wont work!
Action Setup
After the folder is configured, the next step is to validate the schema against an online validator. A solution can be found at Online XML Schema Validator. The schema used to validate against can be found inside the UBIK Folder and is named xsd_schema_validation.
The action mapping xml contains different actions such as GeometryAction (3D Object), MovieAction and UBIKObjectAction.
All Action tags must specify a Tracking id, as an attribute. The Tracking id must exist in the corresponding tracking xml within a <SensorCOSID> tag.
If a texture is used for a geometry, the material (*.mtl file) and the texture (picture) must all exist in the same place in order for to have the 3D object displayed properly, Only the geometry has to be specified as a resource in the Action Mapping, though.
Displaying 3D objects
3D objects can be displayed using the <GeometryAction> tag. The sub-tag <GeometryResource> defines the content and the parameters for displaying the 3D object.
GeometryResource Tag
The GeometryResource contains:
Resource path: the resource path of the 3D object or video to be displayed.
Scale: if specified, the 3D object will be scaled to this size.
OffsetMillimeters: if specified, this value will be added to the position of the detected marker when displaying the 3D object. The offset can be defined along the X, Y and Z axis.
RotationDegrees. if specified, the 3D object will be rotated by this value against the detected marker.
Resource path example. pump/pump.obj.
OffsetMillimeters example.
<OffsetMillimeter> <X>10</X> </OffsetMillimeter>
In the following rotation example the user must see the 3D object rotated around X axis and around Z axis 90 degrees.
Note that the angle is in radians.
Inside the MovieAction tag there can be two possible resources defined, a MovieResource and a PlayButton resource.
MovieResource Tag
Movies can be displayed using the <MovieResource> tag, which basically contains the same values as the GeometryResource, except the rotation vector.
PlayButton Tag
By using the <PlayButton> tag, the movie will not start immediately but there will be a geometry shown in between which basically contains the same values as the GeometryResource tag. Its purpose is to start the video only when this intermediate geometry is touched.
The <UBIKObjectAction> allows to bring up a popup to navigate to a UBIK® object when scanning either a picture or an id marker. The tag must contain the tracking id attribute and, optional, the <UBIK-UID> tag.
When configuring a tag without the UBIK-UID sub-tag, the object is searched based on the value of its MarkerID property, which is the compared to the value of the TrackingID attribute. If the UBIK-UID' tag exists the object is searched based on the value inside the UBIK-UID' tag.
Examples
In order to use the previously configured xml's, you can use either the ID Marker activity or the Markerless activity on the UBIK® Android Client.
ID Marker Activity
The id markers used can be found at the following link ID Marker Example Ids 1-6.
Having in mind the setup tracking ids, you can now scan id markers.
For an id that has a 3D object mapped in the action xml, the object should be displayed on the screen as shown in the next picture.
If the id has a video object mapped in the action xml, you should see a video object on the screen, depending on the existence of the play button. Clicking the play button starts the video.
If the play button exist you should see first see the play button, and after it's clicked the mapped video. If the play button doesn't exist, a movie preview image will be shown. Clicking the image starts the video.
Markerless Activity
The markerless photos used in this example can be found at the following link Markerless example pictures.
The scenario is very similar with the id marker activity with the only difference that instead of ids you have to scan your tracking images.
Results
With the existent configuration from the zip file, you should see the following picture when scanning the first id or the first picture:
When scanning the second id or the second picture, you should see the following:
When scanning the sixth id, using the Markerless activity, you should see a play button and, if pressed, a movie.
Play button:
Movie:
When scanning the sixth id using the IdMarker Activity you should see a play button also and, if pressed, a movie too.