/** * This function is wrapper on the ARELXMLHelper class to offer localization and make POIs creation process easy * @param $objects_array: array of POIs object * @param string $lang: Language of the phone for localization * @param null $html_page: The Html page path to show in your channel if any */ function createLocationBasedAREL($objects_array, $lang = 'en', $html_page = NULL) { //getting language pack according to the user specified language $translator = new JsonTranslator($lang); $language_pack = $translator->getLanguagePack(LANGUAGE_INFO); if ($lang != 'en') { //getting language pack for english so that if the user specified language pack don't have a specific word, then the english word can be used. $language_pack_en = self::getLocals(array('en')); } ArelXMLHelper::start(NULL, $html_page, ArelXMLHelper::TRACKING_GPS); if (!empty($objects_array)) { foreach ($objects_array as $object) { $popup = $object->getPopup(); $buttons = $popup->getButtons(); $new_buttons_array = array(); foreach ($buttons as $button) { if (isset($language_pack[$button[0]])) { $button[0] = utf8_encode($language_pack[$button[0]]); } elseif (isset($language_pack_en[$button[0]])) { $button[0] = utf8_encode($language_pack_en[$button[0]]); } array_push($new_buttons_array, $button); } $popup->setButtons($new_buttons_array); $object->setPopup($popup); ArelXMLHelper::outputObject($object); } } ArelXMLHelper::end(); }
<?php /** * @copyright Copyright 2012 metaio GmbH. All rights reserved. * @link http://www.metaio.com * @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 **/ //if issues occur with htaccess, also the path variable can be used //htaccess rewrite enabled: //Callback URL: http://www.callbackURL.com // //htacces disabled: //Callback URL: http://www.callbackURL.com/?path= require_once '../ARELLibrary/arel_xmlhelper.class.php'; //use the Arel Helper to start the output with arel //start output ArelXMLHelper::start(NULL, "arel/index.php", "http://dev.junaio.com/publisherDownload/tutorial/tracking_tutorial.zip"); //end the output ArelXMLHelper::end();
* * @abstract This tutorial will create a simple scavenger hunt. The user is provided with several markings in his environment. Once he is close to one of those, * he/she can hit the scan button and scan the glue man to find a treasure. * * Learnings: * - GUI buttons * - switching between GLUE and Location Based information * - tracking handling **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; if (!empty($_GET['l'])) { $position = explode(",", $_GET['l']); } else { trigger_error("user position (l) missing. For testing, please provide a 'l' GET parameter with your request. e.g. pois/search/?l=23.34534,11.56734,0"); } //create the xml start ArelXMLHelper::start(NULL, "arel/index.html", NULL); //start by defining some positions of geo referenced POIs and give those names and thumbnails $treasureLocations = array(array("37.772547,-122.418437,0", "San Francisco", "NorthAmerica"), array("48.160747,11.551219,0", "Munich", "Europe"), array("48.857261,2.3493,0", "Paris", "Europe"), array("40.73269,-73.995094,0", "New York", "NorthAmerica"), array("-33.92399,18.463669,0", "Cape Town", "Africa"), array("30.062557,31.246433,0", "Cairo", "Africa"), array("-37.813107,144.96304,0", "Melbourne", "Australia"), array("3.139145,101.689396,0", "Kuala Lumpur", "Asia"), array("35.685187,139.692306,0", "Tokio", "Asia"), array("19.019279,72.849541,0", "Mumbai", "Asia"), array("-12.042007,-77.040482,0", "Lima", "SouthAmerica"), array("51.493355,-0.127945,0", "London", "Europe")); //display the POIs as defined in the Constructor foreach ($treasureLocations as $i => $findPOI) { //title of the POI $title = "Treasure " . $findPOI[1]; //create the POI $poi = ArelXMLHelper::createLocationBasedPOI($i, $title, explode(",", $findPOI[0]), "thumb.png", "icon.png", "A beautiful city", NULL); //20000km -> 20'000'000m -> see them all over the world $poi->setMaxDistance(20000000); ArelXMLHelper::outputObject($poi); } ArelXMLHelper::end(); exit;
* @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, "file.html", "assets/tracking_tutorial.zip"); //return the metaio man on coordinate system 1 / reference image 1 $oObject = ArelXMLHelper::createGLUEModel3D("1", "assets/metaioman.md2", "assets/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();
* @author Frank Angermann * * @abstract Learn about the different types of POIs available in junaio. It is a different media type linked with each POI. * * Learnings: * - create multiple POIs within 1 channel * - use the AREL XML Helper to create the XML output * - link movie, sound or image with the POI * - create a custom HTML overlay to be referenced and opened one the custom POI is clicked * - adding parameters to the POI to be used in AREL JS * **/ 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_GPS); //1. Sound POI $oObject = ArelXMLHelper::createLocationBasedPOI("1", "Hello Sound POI", array(48.1231, 11.218648, 0), "/resources/thumb_sound.png", "/resources/icon_sound.png", "This is our Sound POI", array()); //output the object ArelXMLHelper::outputObject($oObject); //2. Image POI $oObject = ArelXMLHelper::createLocationBasedPOI("2", "Hello Image POI", array(48.12325, 11.218691, 0), "/resources/thumb_image.png", "/resources/icon_image.png", "This is our Image POI\n\nThe image source is: http://www.flickr.com/photos/ediamjunaio/5206110815/", array(array("Show Image", "imageButton", "http://farm5.static.flickr.com/4104/5206110815_7ea891be0b.jpg"))); //output the object ArelXMLHelper::outputObject($oObject); //3. Video POI $oObject = ArelXMLHelper::createLocationBasedPOI("3", "Hello Video POI", array(48.12307, 11.218636, 0), "/resources/thumb_video.png", "/resources/icon_video.png", "This is our Video POI", array(array("Start Movie", "movieButton", "http://dev.junaio.com/publisherDownload/tutorial/movie.mp4"))); //output the object ArelXMLHelper::outputObject($oObject); //4. Custom POPup POI $oObject = ArelXMLHelper::createLocationBasedPOI("4", "Custom PopUp", array(48.12317, 11.21867, 0), "/resources/thumb_custom.png", "/resources/icon_custom.png", array()); //add some parameters we will need with AREL
/** * @copyright Copyright 2012 metaio GmbH. All rights reserved. * @link http://www.metaio.com * @author Frank Angermann * * @abstract Using junaio with LLA Markers or other references for creating highly accurate indoor experiences * * Learnings: * - receive encoded lat, long, alt positions from the LLA markers * - manually override the users positions (deactivate the GPS) * - switching POIs visible on the fly **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; //make sure to provide the lla marker tracking configuration ArelXMLHelper::start(NULL, "arel/index.html", ArelXMLHelper::TRACKING_LLA_MARKER); //first arrow $arrowObject = ArelXMLHelper::createLocationBasedModel3D("arrow1", "Arrow", "resources/arrow.zip", "resources/arrow.png", array(37.783248, -122.403244, 0), array(600, 600, 600), new ArelRotation(ArelRotation::ROTATION_EULERRAD, array(1.57, 0, 2.37))); //set the poi invisible in liveview, mapview/listview and radar $arrowObject->setVisibility(false, false, false); //move the arrow a little down $arrowObject->setTranslation(array(0, 0, -1500)); ArelXMLHelper::outputObject($arrowObject); //second arrow $arrowObject = ArelXMLHelper::createLocationBasedModel3D("arrow2", "Arrow", "resources/arrow.zip", "resources/arrow.png", array(37.783212, -122.403192, 0), array(600, 600, 600), new ArelRotation(ArelRotation::ROTATION_EULERRAD, array(1.57, 0, 2.37))); //set the poi invisible in liveview, mapview/listview and radar $arrowObject->setVisibility(false, false, false); //move the arrow a little down $arrowObject->setTranslation(array(0, 0, -1500)); ArelXMLHelper::outputObject($arrowObject); //1. Sound POI
* @copyright Copyright 2012 metaio GmbH. All rights reserved. * @link http://www.metaio.com * @author Frank Angermann * * @abstract The tutorial shows how to use the google analytics plugin in combination with your channel. Please make sure to include * your profile ID in the config.php. More information can be found on junai in the arel plugin section. * Please make sure to follow the Google Analytics Terms of service. * * Learnings: * - using Google Analytics with junaio * - calling javascript methods from a popup button **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; //use the Arel Helper to start the output with arel //start output ArelXMLHelper::start(NULL, "/arel/index.php?analyticsuser="******"1", "Hello Sound POI", array(48.1231, 11.218648, 0), "/resources/thumb_sound.png", "/resources/icon_sound.png", "This is our Sound POI", array(array("Start Audio", "soundButton", "javascript: startSound(\"http://dev.junaio.com/publisherDownload/tutorial/test.mp3\")"))); //output the object ArelXMLHelper::outputObject($oObject); //2. Image POI $oObject = ArelXMLHelper::createLocationBasedPOI("2", "Hello Image POI", array(48.12325, 11.218691, 0), "/resources/thumb_image.png", "/resources/icon_image.png", "This is our Image POI\n\nThe image source is: http://www.flickr.com/photos/ediamjunaio/5206110815/", array(array("Show Image", "imageButton", "javascript: openImage(\"http://farm5.static.flickr.com/4104/5206110815_7ea891be0b.jpg\")"))); //output the object ArelXMLHelper::outputObject($oObject); //3. Video POI $oObject = ArelXMLHelper::createLocationBasedPOI("3", "Hello Video POI", array(48.12307, 11.218636, 0), "/resources/thumb_video.png", "/resources/icon_video.png", "This is our Video POI", array(array("Start Movie", "movieButton", "javascript: startVideo(\"http://dev.junaio.com/publisherDownload/tutorial/movie.mp4\")"))); //output the object ArelXMLHelper::outputObject($oObject); //4. Custom POPup POI $oObject = ArelXMLHelper::createLocationBasedPOI("4", "Custom PopUp", array(48.12317, 11.21867, 0), "/resources/thumb_custom.png", "/resources/icon_custom.png"); //add some parameters we will need with AREL
<?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();
<?php require_once 'ARELLibrary/arel_xmlhelper.class.php'; //start output ArelXMLHelper::start(NULL, "OpLogo.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); //output the object ArelXMLHelper::outputObject($deer); ArelXMLHelper::outputObject($sheep); ArelXMLHelper::outputObject($tricycle); //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();
* @copyright Copyright 2012 metaio GmbH. All rights reserved. * @link http://www.metaio.com * @author Frank Angermann * * @abstract Learn how to reference a movie texture (movie in liveview), alpha transparent movie and an image on different reference images. * * Learnings: * - using multiple reference images / coordinate systems * - create 3D Models from movies (3G2) - movie textures and images(png, jpg) to display in the live view * - using alpha transparent movies * - using AREL JS to control the movies * **/ 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_glue5.zip"); //video $oObject = ArelXMLHelper::createGLUEModel3DFromMovie("movie", "resources/coral.3g2", array(0, 0, 0), array(2.5, 2.5, 2.5), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 1); //output the object ArelXMLHelper::outputObject($oObject); //image $oObject = ArelXMLHelper::createGLUEModel3DFromImage("image", "resources/image.png", array(0, -70, 0), array(5, 5, 5), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, 0)), 2); //output the object ArelXMLHelper::outputObject($oObject); //transparent video $oObject = ArelXMLHelper::createGLUEModel3DFromMovie("movieTransparent", "resources/sampleMovie.alpha.3g2", array(0, -50, 0), array(2.5, 2.5, 2.5), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, -90)), 3); //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 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();
* * Learnings: * - create two Location Based 3D Models using the Arel XML Helper * - place the metaio man and the t-rex relative to the user's current position * - use 1 obj and 1 md2 model * **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; if (!empty($_GET['l'])) { $position = explode(",", $_GET['l']); } else { trigger_error("user position (l) missing. For testing, please provide a 'l' GET parameter with your request. e.g. pois/search/?l=23.34534,11.56734,0"); } //calculate the position of T-Rex based on the position of the request. An offset is added to the latitude value. $tRexLocation = $position; $tRexLocation[0] += 4.0E-5; //metaio man location $metaioManLocation = $position; $metaioManLocation[1] += 4.0E-5; //use the Arel Helper to start the output with arel //start output ArelXMLHelper::start(NULL, NULL, ArelXMLHelper::TRACKING_GPS); //T-Rex as static obj $oObject = ArelXMLHelper::createLocationBasedModel3D("trex", "The T-Rex", "http://dev.junaio.com/publisherDownload/junaio_model_obj.zip", NULL, $tRexLocation, array(5, 5, 5), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, -90, 0))); ArelXMLHelper::outputObject($oObject); //metiao man md2 $oObject = ArelXMLHelper::createLocationBasedModel3D("metaioMan", "The metaio Man", "http://dev.junaio.com/publisherDownload/tutorial/metaioman.md2", "http://dev.junaio.com/publisherDownload/tutorial/metaioman.png", $metaioManLocation, array(20, 20, 20), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 0, -90))); //output the object ArelXMLHelper::outputObject($oObject); //end the output ArelXMLHelper::end();
* - use scaling to hide the models that are not needed to a given time * - provide additional parameter in the AREL XML output to be used by AREL JS * - show html information on which image to track * - hide and display the "what to track" information based on tracking events * - show a new model in certain circumstances * **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; //Define the card game size define('AMOUNT_OF_CARDS', 16); //if changed, make sure it is an even number ;) define('CARDS_PER_ROW', 4); $trackingXML = "resources/trackingMusic.zip"; //stat the AREL output //make sure to pass the information, on how many cards are in the game to the AREL JS side ArelXMLHelper::start(NULL, "arel/index.php?amntCards=" . AMOUNT_OF_CARDS, $trackingXML); //randomize the order of the cards $cardIDs = range(1, AMOUNT_OF_CARDS); shuffle($cardIDs); //return the cards with different textures for ($i = 0; $i < AMOUNT_OF_CARDS; $i++) { //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
* @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", "assets/tracking_tutorial.zip"); //return the metaio man on coordinate system 1 / reference image 1 $oObject = ArelXMLHelper::createGLUEModel3D("1", "assets/metaioman.md2", "assets/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();
* @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 **/ error_reporting(E_ALL); 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.html", NULL); //Create the blaster $id = "blaster"; $model = "legoBlaster.zip"; $texture = "legoBlaster.png"; $screenAnchor = ArelAnchor::ANCHOR_BR; $scale = array(0.75, 0.75, 0.75); $rotation = array(0, 90, 0); $oObject = ArelXMLHelper::createScreenFixedModel3D($id, $model, $texture, $screenAnchor, $scale, new ArelRotation(ArelRotation::ROTATION_EULERDEG, $rotation)); ArelXMLHelper::outputObject($oObject); //Create the Crosshair $id = "fadenkreuz"; $model = ""; $texture = "fadenkreuz.png"; $screenAnchor = ArelAnchor::ANCHOR_CC; $scale = array(1, 1, 1);
* - playing sounds in junaio * * Animation Flow in the tutorial: * trooper "appear" -> metaio man fade in (no animation) -> metaio man "idle" {1s after metaio man is done fading in} trooper "fire" -> * metaio man "shock_up" -> metaio man "idle" once -> metaio man "close_down" -> metaio man "close_up" AND trooper "die" -> metaio man "idle" * * {2s after trooper died} * 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
<?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();
<?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();
<?php /** * @copyright Copyright 2012 metaio GmbH. All rights reserved. * @link http://www.metaio.com * @author Frank Angermann * * @abstract Using junaio to create a 360 degree experience * * Learnings: * - use create360Object in the Arel XML Helper **/ require_once '../ARELLibrary/arel_xmlhelper.class.php'; ArelXMLHelper::start(NULL, NULL, "Orientation"); //first arrow $object360 = ArelXMLHelper::create360Object("360", "/resources/360_new.zip", "/resources/photo.JPG", array(0, 0, -1500), array(40000, 40000, 40000), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 0))); //make sure the object is always rendered first. small number == draw first //not necessary here, but might be important if you have other 360objects with transparency in the scene $object360->setRenderOrderPosition(-1000); ArelXMLHelper::outputObject($object360); ArelXMLHelper::end();