* - 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); $rotation = array(0, 0, 0); $oObject = ArelXMLHelper::createScreenFixedModel3D($id, $model, $texture, $screenAnchor, $scale, new ArelRotation(ArelRotation::ROTATION_EULERDEG, $rotation)); ArelXMLHelper::outputObject($oObject); //end the output ArelXMLHelper::end();
* @link http://www.metaio.com * @author Frank Angermann * * @abstract Your own AR Shooter * * Learnings: * (Simple) * - use occlusion with location based channels * - advanced animation control * - use the getObjectFromScreenCoordinates to determine which 3D model was hit * (Advanced) - look for the *ADVANCED* comments * - adding new models on the fly (more troopers to shoot) **/ 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"); } ArelXMLHelper::start(NULL, "/arel/index.html", ArelXMLHelper::TRACKING_GPS); //a trooper $legoMan = ArelXMLHelper::create360Object("legoTrooper", "/resources/legoStormTrooper.zip", "/resources/legoStormTrooper.png", array(0, 2000, -1500), array(0.4, 0.4, 0.4), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 90))); ArelXMLHelper::outputObject($legoMan); //the weapon $legoWeapon = ArelXMLHelper::createScreenFixedModel3D("legoBlaster", "/resources/legoBlaster.zip", "/resources/legoBlaster.png", ArelAnchor::ANCHOR_BR, array(1, 1, 1), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(0, 90, 0))); ArelXMLHelper::outputObject($legoWeapon); //occlusion model $box = ArelXMLHelper::create360Object("box", "/resources/occlusionBox.zip", NULL, array(0, 0, -6400), array(50, 50, 50), new ArelRotation(ArelRotation::ROTATION_EULERDEG, array(90, 0, 90))); $box->setOccluding(true); ArelXMLHelper::outputObject($box); ArelXMLHelper::end();