<?php

require_once 'ARELLibrary/arel_xmlhelper.class.php';
//start output
ArelXMLHelper::start(NULL, "loading.html", "assets/Tracking.zip");
$deer = ArelXMLHelper::createGLUEModel3D("1", "assets/deer.obj", "assets/dog_uvw_02.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
$sheep = ArelXMLHelper::createGLUEModel3D("2", "assets/sheep.obj", "assets/sheep_uvw_02.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(-90, 0, 0)), 2);
$tricycle = ArelXMLHelper::createGLUEModel3D("3", "assets/tricycle.obj", "assets/tricycle_uvw_tex.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 0)), 3);
// $doll = ArelXMLHelper::createGLUEModel3D(
// "3",	//ID
// "assets/dolls.mfbx", //model Path
// "assets/tricycle_uvw_tex.png", //texture Path
// array(0,-100,0), //translation
// array(3,3,3), //scale
// new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90,0,0)), //rotation
// 4 //CoordinateSystemID
// );
//output the object
ArelXMLHelper::outputObject($deer);
ArelXMLHelper::outputObject($sheep);
ArelXMLHelper::outputObject($tricycle);
// ArelXMLHelper::outputObject($doll);
//end the output
ArelXMLHelper::end();
 *  			start over! 
 **/
error_reporting(E_ALL);
//for displaying errors
ini_set("display_errors", 1);
require_once '../ARELLibrary/arel_xmlhelper.class.php';
//use the Arel Helper to start the output with arel
//start output
ArelXMLHelper::start(NULL, "arel/index.html", "resources/tracking_tutorial.zip");
//metaio man 3D Model
//Important: note how it is set to transparent
$oObject = ArelXMLHelper::createGLUEModel3D("mMan", "resources/metaioman.md2", "resources/metaioman.png", array(-150, -100, 0), array(2, 2, 2), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 90)), 1);
//set the object transparent
$oObject->setTransparency(1);
//return the model
ArelXMLHelper::outputObject($oObject);
//2. a trooper model
//note the additional parameter that is used in AREL JS
$oObject = ArelXMLHelper::createGLUEModel3D("lTrooper", "resources/legoStormTrooper.zip", "resources/legoStormTrooper.png", array(150, -100, 0), array(0.1, 0.1, 0.1), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 0)), 1);
//the sound will be needed in AREL JS once the anmation starts
$oObject->addParameter("appearSound", "resources/beam.mp3");
//return the model
ArelXMLHelper::outputObject($oObject);
//the occlusion box, making the trooper invisible for the time it has not appeared
$box = ArelXMLHelper::createGLUEModel3D("box", "resources/occlusionBox.zip", NULL, array(0, -350, -350), array(7, 7, 7), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
//this model is set as a occlusion model
$box->setOccluding(true);
//output the object
ArelXMLHelper::outputObject($box);
//end the output
ArelXMLHelper::end();
<?php

require_once 'ARELLibrary/arel_xmlhelper.class.php';
//start output
ArelXMLHelper::start(NULL, "FrntEnd.html", "assets/Tracking.zip");
$deer = ArelXMLHelper::createGLUEModel3D("deer", "assets/deer.obj", "assets/dog_uvw_02.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
$sheep = ArelXMLHelper::createGLUEModel3D("sheep", "assets/sheep.obj", "assets/sheep_uvw_02.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 2);
$tricycle = ArelXMLHelper::createGLUEModel3D("tryc", "assets/tricycle.obj", "assets/tricycle_uvw_tex.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 3);
$doll = ArelXMLHelper::createGLUEModel3D("metaio", "assets/metaioman.md2", "assets/metaioman.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 4);
//output the object
ArelXMLHelper::outputObject($deer);
ArelXMLHelper::outputObject($sheep);
ArelXMLHelper::outputObject($tricycle);
ArelXMLHelper::outputObject($doll);
//end the output
ArelXMLHelper::end();
 * @author     Frank Angermann
 * 
 * @abstract	This tutorial gives you a basic understanding of image recogination with junaio and working with animated md2 models. 
 * 				You will need the metaio man image.
 * 				
 * 				Learnings:
 * 					- overlay a 3D model on an image
 * 					- show html information on which image to track
 * 					- hide and display the "what to track" information based on tracking events
 * 					- start an animation based on touchstart (click) event of the object
 * 					- start an animation based on animation ended event of the object 
 **/
require_once '../ARELLibrary/arel_xmlhelper.class.php';
/**
 * When the channel is being viewed, a poi request will be sent
 * $_GET['l']...(optional) Position of the user when requesting poi search information
 * $_GET['o']...(optional) Orientation of the user when requesting poi search information
 * $_GET['p']...(optional) perimeter of the data requested in meters.
 * $_GET['uid']... Unique user identifier
 * $_GET['m']... (optional) limit of to be returned values
 * $_GET['page']...page number of result. e.g. m = 10: page 1: 1-10; page 2: 11-20, e.g.
 **/
//use the Arel Helper to start the output with arel
//start output
ArelXMLHelper::start(NULL, "/arel/index.html", "http://dev.junaio.com/publisherDownload/tutorial/tracking_tutorial.zip");
//return the metaio man on coordinate system 1 / reference image 1
$oObject = ArelXMLHelper::createGLUEModel3D("1", "http://dev.junaio.com/publisherDownload/tutorial/metaioman.md2", "http://dev.junaio.com/publisherDownload/tutorial/metaioman.png", array(0, -100, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(-90, 0, 0)), 1);
//output the object
ArelXMLHelper::outputObject($oObject);
//end the output
ArelXMLHelper::end();
<?php

/**
 * @copyright  Copyright 2012 metaio GmbH. All rights reserved.
 * @link       http://www.metaio.com
 * @author     Frank Angermann
 * 
 * @abstract	This tutorial is a basic tutorial for using junaio in combination with ID Markers and marker interactions.
 * 				The idea is to be able to hide ID Marker 2 or 3 and this triggers an animation. So if either of those markers is tracking, nothing happens, but 
 * 				if one looses the tracking, the rotation of the lego man on marker 1 starts.
 * 
 *  			Learnings:
 *  					- Using ID Markers
 *  					- Controlling interactions by hiding a marker
 *  					- advanced usage of AREL JavaScript
 *  					- handling multiple tracking events
 **/
require_once '../ARELLibrary/arel_xmlhelper.class.php';
//use the Arel Helper to start the output with arel
//start output
ArelXMLHelper::start(NULL, "/arel/index.html", "/resources/trackingXML1-3.xml");
//return the trooper and place him on ID Marker 2
$oObject = ArelXMLHelper::createGLUEModel3D("lTrooper", "/resources/legoStormTrooper.zip", "/resources/legoStormTrooper.png", array(0, 0, 0), array(0.05, 0.05, 0.05), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 2);
ArelXMLHelper::outputObject($oObject);
//end the output
ArelXMLHelper::end();
/**
 * @copyright  Copyright 2012 metaio GmbH. All rights reserved.
 * @link       http://www.metaio.com
 * @author     Frank Angermann
 * 
 * @abstract	This tutorial provides a model using a reflection map.
 * 				 				
 * 				Learnings:
 * 					- how to use reflection maps
 **/
require_once '../ARELLibrary/arel_xmlhelper.class.php';
//use the Arel Helper to start the output with arel
/**
 * 	For more information about using reflection map, please look at those pages:
 * 	
 * 	http://dev.metaio.com/content-creation/environment-mapping/
 *  http://dev.metaio.com/sdk/tutorials/content-types/
 * 
 */
//start output
$list = array();
$list["EnvironmentMap"] = "resources/space.jpeg";
ArelXMLHelper::start(NULL, "index.html", "resources/tracking_tutorial.zip", $list);
//output the truck with reflection maps included
$oObject = ArelXMLHelper::createGLUEModel3D("1", "truck.zip", NULL, array(0, 0, 0), array(1, 1, 1), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 0)), 1);
//output the object
ArelXMLHelper::outputObject($oObject);
$oObject1 = ArelXMLHelper::createGLUEModel3D("2", "sphere.zip", NULL, array(0, 200, 80), array(70, 70, 70), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
ArelXMLHelper::outputObject($oObject1);
//end the output
ArelXMLHelper::end();
<?php

/**
 * @copyright  Copyright 2012 metaio GmbH. All rights reserved.
 * @link       http://www.metaio.com
 * @author     Frank Angermann
 * 
 * @abstract	Using 3D models in a 360 degree setting in junaio and learn how to do animations with AREL JavaScript
 * 				
 * 				Learnings:
 * 					- create two 3D Models using the Arel XML Helper
 * 					- place the t-rex and the metaio man relative to the user's position
 * 					- use 1 zipped md2 and an encrypted md2
 * 					- start animations using AREL JavaScript and react to its callbacks
 **/
require_once '../ARELLibrary/arel_xmlhelper.class.php';
//use the Arel Helper to start the output with arel
//start output
ArelXMLHelper::start(NULL, "/arel/index.html", ArelXMLHelper::TRACKING_ORIENTATION);
//T-Rex as encrypted md2
// We are using relative offsets, so we don't need a location based model
$oObject = ArelXMLHelper::createGLUEModel3D("trex", "http://dev.junaio.com/publisherDownload/tutorial/trex.md2_enc", "http://dev.junaio.com/publisherDownload/tutorial/trextexture.png", array(4000, 0, -1300), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
//output the trex
ArelXMLHelper::outputObject($oObject);
//metiao man zipped md2
$oObject = ArelXMLHelper::createGLUEModel3D("metaioMan", "http://dev.junaio.com/publisherDownload/tutorial/metaioman.zip", NULL, array(2000, -700, -1300), array(8, 8, 8), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 90)), 1);
//output the metaio man
ArelXMLHelper::outputObject($oObject);
//end the output
ArelXMLHelper::end();
    //position the cards
    $y = 150 * floor($i / CARDS_PER_ROW) - 200;
    $x = 150 * ($i % CARDS_PER_ROW) - 250;
    //get the texture -> texture name is one for the odd ones (so 1 and 2 have the same texture, texture is only 1)
    //you can check the resources folder: e.g. texture_1.png, texture_3.png, etc...
    $j = $cardIDs[$i];
    if ($cardIDs[$i] % 2 == 0) {
        $j = $cardIDs[$i] - 1;
    }
    //create the memory card
    $memoryCard = ArelXMLHelper::createGLUEModel3D($cardIDs[$i], "resources/memory.zip", "resources/texture_{$j}.png", array($x, $y, 0), array(3, 3, 3), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1);
    //add a parameter to the memory Card to which model shall be opened once the matching pair is found
    //see further down ($foundModel)
    $memoryCard->addParameter("foundModelID", "model_{$j}");
    //output the memory card one by one
    ArelXMLHelper::outputObject($memoryCard);
}
//the models if a match was found
$aModelIDs = array("model_1", "model_3", "model_5", "model_7", "model_9", "model_11", "model_13", "model_15");
//return all the models to be opened
foreach ($aModelIDs as $model) {
    //return the model to be found -> scale them really tiny, so they are not seen
    $foundModel = ArelXMLHelper::createGLUEModel3D($model, "resources/models/{$model}.zip", NULL, array(0, 0, 0), array(0.01, 0.01, 0.01), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 90)), 1);
    //currently, we have to make sure the sound is being downloaded -> add it to the parameter
    //if only referenced in AREL JS, it will not be downloaded
    //this sound will be played when the model is found
    $foundModel->addParameter("soundFound", "resources/sound/{$model}.mp3");
    //output
    ArelXMLHelper::outputObject($foundModel);
}
ArelXMLHelper::end();