SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Downloaden Sie, um offline zu lesen
COSC 426: Augmented Reality

           Mark Billinghurst
     mark.billinghurst@hitlabnz.org

           August 14th 2012

          Lecture 6: osgART
osgART

Developing Augmented Reality
  Applications with osgART
What is a Scene Graph?
  Tree-like structure for organising a virtual world
     e.g. VRML
  Hierarchy of nodes that define:
       Groups (and Switches, Sequences etc…)
       Transformations
       Projections
       Geometry
       …
  And states and attributes that define:
     Materials and textures
     Lighting and blending
     …
Scene Graph Example
Benefits of a Scene Graph
  Performance
     Structuring data facilitates optimization
      -  Culling, state management, etc…
  Abstraction
     Underlying graphics pipeline is hidden
     Low-level programming (“how do I display
      this?”) replaced with high-level concepts   Image: sgi

      (“what do I want to display?”)
About Open Scene Graph
    http://www.openscenegraph.org/
    Open-source scene graph implementation
    Based on OpenGL
    Object-oriented C++ following design pattern principles
    Used for simulation, games, research, and industrial projects
    Active development community
       Maintained by Robert Osfield
       ~2000 mailing list subscribers
       Documentation project: www.osgbooks.com
  Uses the OSG Public License (similar to LGPL)
About Open Scene Graph (2)



Pirates of the XXI Century         Flightgear               SCANeR




         3DVRII              Research Institute EOR   VRlab Umeå University
Open Scene Graph Features
  Plugins for loading and saving
     3D: 3D Studio (.3ds), OpenFlight (.flt), Wavefront (.obj)…
     2D: .png, .jpg, .bmp, QuickTime movies
  NodeKits to extend functionality
     e.g. osgShadow
  Cross-platform support for:
     Window management (osgViewer)
     Threading (OpenThreads)
Open Scene Graph Architecture
 Inter-operability with
  other environments,
       e.g. Python




Plugins read and                            NodeKits extend
write 2D image and                          core functionality,
3D model files            Scene graph and   exposing higher-level
                              rendering     node types
                            functionality
Some Open Scene Graph Demos



         osgviewer                              osgmotionblur                        osgparticle




         osgreflect                              osgdistortion                      osgfxbrowser

  You may want to get the OSG data package:
        Via SVN: http://www.openscenegraph.org/svn/osg/OpenSceneGraph-Data/trunk
Learning OSG
  Check out the Quick Start Guide
      Free PDF download at http://osgbooks.com/, Physical copy $13US
  Join the mailing list: http://www.openscenegraph.org/projects/osg/wiki/
   MailingLists

  Browse the website: http://www.openscenegraph.org/projects/osg
  Use the forum: http://forum.openscenegraph.org

  Study the examples
  Read the source? 
osgART
What is osgART?
  osgART adds AR to Open Scene Graph
  Further developed and enhanced by:
    Julian Looser
    Hartmut Seichter
    Raphael Grasset
  Current version 2.0, Open Source
    http://www.osgart.org
osgART Approach: Basic Scene Graph
   Root




             [                        ]
              0.988 -0.031   -0.145   0
             -0.048 0.857    -0.512   0
 Transform    0.141 0.513     0.846
             10.939 29.859 -226.733
                                      0
                                      1




                                            To add Video see-through AR:
 3D Object                                     Integrate live video
                                               Apply correct projection matrix
                                               Update tracked transformations in
                                                realtime
osgART Approach: AR Scene Graph
               Root




             Transform




             3D Object
osgART Approach: AR Scene Graph
                Root


               Virtual
               Camera
       Video
                         Transform
       Layer


      Video
                         3D Object
      Geode
osgART Approach: AR Scene Graph
                             Root
                                      Projection matrix from
                                      tracker calibration

    Orthographic                                        Transformation matrix
    projection
                            Virtual
                                                        updated from marker
                            Camera                      tracking in realtime
                    Video
                                      Transform
                    Layer
Full-screen quad
with live texture
updated from
Video source        Video
                                      3D Object
                    Geode
osgART Approach: AR Scene Graph
                             Root
                                      Projection matrix from
                                      tracker calibration

    Orthographic                                        Transformation matrix
    projection
                            Virtual
                                                        updated from marker
                            Camera                      tracking in realtime
                    Video
                                      Transform
                    Layer
Full-screen quad
with live texture
updated from
Video source        Video
                                      3D Object
                    Geode
osgART Architecture
  Like any video see-through AR library, osgART requires video
   input and tracking capabilities.


                Video Source
               e.g. DirectShow




                                 AR Library




                                               Application
               Tracking Module
                  (libAR.lib)
osgART Architecture
  osgART uses a plugin architecture so that video sources and tracking
   technologies can be plugged in as necessary
                           OpenCVVideo -
                              VidCapture -
                               CMU1394 -
                          PointGrey SDK -
                            VidereDesign -




                                              Video Plugin
                          VideoWrapper -
                               VideoInput -
                             VideoSource -




                                                                        Application
                                    DSVL -




                                                               osgART
                            Intranel RTSP -




                                              Tracker Plugin
                              ARToolKit4 -
                           ARToolkitPlus -
                            MXRToolKit -
                                   ARLib -
                 bazAR (work in progress) -
                 ARTag (work in progress) -
Basic osgART Tutorial
  Develop a working osgART application from scratch.
  Use ARToolKit 2.72 library for tracking and video
   capture
osgART Tutorial 1: Basic OSG Viewer
  Start with the standard Open Scene Graph Viewer
  We will modify this to do AR!
osgART Tutorial 1: Basic OSG Viewer
  The basic osgViewer…
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>

int main(int argc, char* argv[])   {

    // Create a viewer
    osgViewer::Viewer viewer;

    // Create a root node
    osg::ref_ptr<osg::Group> root = new osg::Group;

    // Attach root node to the viewer
    viewer.setSceneData(root.get());

    // Add relevant event handlers to the viewer
    viewer.addEventHandler(new osgViewer::StatsHandler);
    viewer.addEventHandler(new osgViewer::WindowSizeHandler);
    viewer.addEventHandler(new osgViewer::ThreadingHandler);
    viewer.addEventHandler(new osgViewer::HelpHandler);

    // Run the viewer and exit the program when the viewer is closed
    return viewer.run();
}
osgART Tutorial 2: Adding Video
  Add a video plugin
     Load, configure, start video capture…
  Add a video background
     Create, link to video, add to scene-graph
osgART Tutorial 2: Adding Video
  New code to load and configure a Video Plugin:
// Preload the video and tracker
int _video_id = osgART::PluginManager::getInstance()-
>load("osgart_video_artoolkit2");

// Load a video plugin.
osg::ref_ptr<osgART::Video> video =
   dynamic_cast<osgART::Video*>(osgART::PluginManager::getInstance()-
>get(_video_id));

// Check if an instance of the video stream could be created
if (!video.valid()) {
   // Without video an AR application can not work. Quit if none found.
   osg::notify(osg::FATAL) << "Could not initialize video plugin!" <<
std::endl;
   exit(-1);
}

// Open the video. This will not yet start the video stream but will
// get information about the format of the video which is essential
// for the connected tracker.
video->open();
osgART Tutorial 2: Adding Video
       New code to add a live video background
osg::Group* createImageBackground(osg::Image* video) {
   osgART::VideoLayer* _layer = new osgART::VideoLayer();
   _layer->setSize(*video);
   osgART::VideoGeode* _geode = new osgART::VideoGeode(osgART::VideoGeode::USE_TEXTURE_2D, video);
   addTexturedQuad(*_geode, video->s(), video->t());
   _layer->addChild(_geode);
   return _layer;
}

       In the main function…

     osg::ref_ptr<osg::Group> videoBackground = createImageBackground(video.get());
     videoBackground->getOrCreateStateSet()->setRenderBinDetails(0, "RenderBin");

     root->addChild(videoBackground.get());
     video->start();
osgART Tutorial 3: Tracking
  Add a Tracker plugin
    Load, configure, link to video
  Add a Marker to track
    Load, activate
  Tracked node
    Create, link with marker via tracking callbacks
  Print out the tracking data
osgART Tutorial 3: Tracking
  Load a tracking plugin and associate it with the video plugin
int _tracker_id = osgART::PluginManager::getInstance()->load("osgart_tracker_artoolkit2");

osg::ref_ptr<osgART::Tracker> tracker =
      dynamic_cast<osgART::Tracker*>(osgART::PluginManager::getInstance()->get(_tracker_id));

if (!tracker.valid()) {
   // Without tracker an AR application can not work. Quit if none found.
   osg::notify(osg::FATAL) << "Could not initialize tracker plugin!" << std::endl;
   exit(-1);
}

// get the tracker calibration object
osg::ref_ptr<osgART::Calibration> calibration = tracker->getOrCreateCalibration();

// load a calibration file
if (!calibration->load("data/camera_para.dat"))
{
   // the calibration file was non-existing or couldnt be loaded
   osg::notify(osg::FATAL) << "Non existing or incompatible calibration file" << std::endl;
   exit(-1);
}

// set the image source for the tracker
tracker->setImage(video.get());

osgART::TrackerCallback::addOrSet(root.get(), tracker.get());

// create the virtual camera and add it to the scene
osg::ref_ptr<osg::Camera> cam = calibration->createCamera();
root->addChild(cam.get());
osgART Tutorial 3: Tracking
  Load a marker and activate it
  Associate it with a transformation node (via event callbacks)
  Add the transformation node to the virtual camera node
osg::ref_ptr<osgART::Marker> marker = tracker->addMarker("single;data/patt.hiro;80;0;0");
if (!marker.valid())
{
   // Without marker an AR application can not work. Quit if none found.
   osg::notify(osg::FATAL) << "Could not add marker!" << std::endl;
   exit(-1);
}

marker->setActive(true);

osg::ref_ptr<osg::MatrixTransform> arTransform = new osg::MatrixTransform();
osgART::attachDefaultEventCallbacks(arTransform.get(), marker.get());
cam->addChild(arTransform.get());

  Add a debug callback to print out information about the tracked marker
osgART::addEventCallback(arTransform.get(), new osgART::MarkerDebugCallback(marker.get()));
osgART Tutorial 3: Tracking

  Tracking information is
   output to console
osgART Tutorial 4: Adding Content
  Now put the tracking data to use!
  Add content to the tracked transform
  Basic cube code
      arTransform->addChild(osgART::testCube());
      arTransform->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin");
osgART Tutorial 5: Adding 3D Model
  Open Scene Graph can load some 3D formats directly:
     e.g. Wavefront (.obj), OpenFlight (.flt), 3D Studio (.3ds), COLLADA
     Others need to be converted
  Support for some formats is much better than others
     e.g. OpenFlight good, 3ds hit and miss.
  Recommend native .osg and .ive formats
     .osg – ASCII representation of scene graph
     .ive – Binary OSG file. Can contain hold textures.
  osgExp : Exporter for 3DS Max is a good choice
     http://sourceforge.net/projects/osgmaxexp
  Otherwise .3ds files from TurboSquid can work
osgART Tutorial 5: Adding 3D Model
  Replace the simple cube with a 3D model
  Models are loaded using the osgDB::readNodeFile() function
std::string filename = "media/hollow_cube.osg";
arTransform->addChild(osgDB::readNodeFile(filename));




                                     Export to .osg



         3D Studio Max


                                                        osgART
  Note: Scale is important. Units are in mm.
osgART Tutorial 6: Multiple Markers
  Repeat the process so far to track more than
   one marker simultaneously
osgART Tutorial 6: Multiple Markers
  Repeat the process so far to track more than one marker
  Load and activate two markers
osg::ref_ptr<osgART::Marker> markerA = tracker->addMarker("single;data/patt.hiro;80;0;0");
markerA->setActive(true);

osg::ref_ptr<osgART::Marker> markerB = tracker->addMarker("single;data/patt.kanji;80;0;0");
markerB->setActive(true);


  Create two transformations, attach callbacks, and add models
osg::ref_ptr<osg::MatrixTransform> arTransformA = new osg::MatrixTransform();
osgART::attachDefaultEventCallbacks(arTransformA.get(), markerA.get());
arTransformA->addChild(osgDB::readNodeFile("media/hitl_logo.osg"));
arTransformA->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin");
cam->addChild(arTransformA.get());

osg::ref_ptr<osg::MatrixTransform> arTransformB = new osg::MatrixTransform();
osgART::attachDefaultEventCallbacks(arTransformB.get(), markerB.get());
arTransformB->addChild(osgDB::readNodeFile("media/gist_logo.osg"));
arTransformB->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin");
cam->addChild(arTransformB.get());
osgART Tutorial 6: Multiple Markers
Basic osgART Tutorial: Summary



Standard OSG Viewer      Addition of Video    Addition of Tracking




Addition of basic 3D   Addition of 3D Model     Multiple Markers
      graphics
FLARManager
http://transmote.com/flar
FLARManager:
  Makes building FLARToolkit apps easier
  Is open-source, with a free and commercial license
  Is designed to allow exploration of both augmented
   reality and alternative controllers
  Decouples FLARToolkit from Papervision3D
  Configuration without recompilation, via xml config
FLARManager: features
    Gives more control over application environment
    Provides multiple input options
    Robust multiple marker management
    Supports multiple 3D frameworks
    Offers features for optimization
    Allows for customization
Resources
Websites
  Software Download
    http://artoolkit.sourceforge.net/
  ARToolKit Documentation
    http://www.hitl.washington.edu/artoolkit/
  ARToolKit Forum
    https://www.artoolworks.com/community/forum/
  ARToolworks Inc
    http://www.artoolworks.com/
  ARToolKit Plus
    http://studierstube.icg.tu-graz.ac.at/handheld_ar/
     artoolkitplus.php
  osgART
    http://www.osgart.org/
  FLARToolKit
    http://www.libspark.org/wiki/saqoosha/FLARToolKit/
  FLARManager
    http://words.transmote.com/wp/flarmanager/
Books
  Interactive Environments with Open-Source
   Software: 3D Walkthroughs and Augmented
   Reality for Architects with Blender 2.43, DART
   3.0 and ARToolKit 2.72 by Wolfgang Höhl

  A Hitchhikers Guide to Virtual Reality by Karen
   McMenemy and Stuart Ferguson
More Information
•  Mark Billinghurst	

   –  mark.billinghurst@hitlabnz.org	

•  Websites	

   –  www.hitlabnz.org

Weitere ähnliche Inhalte

Ähnlich wie 426 lecture6a osgART Development

COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsMark Billinghurst
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityMark Kilgard
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialPatrick O'Shaughnessey
 
Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudeAugmentedWorldExpo
 
Philipp Nagele (Wikitude) Wikitude SDK Tutorial
Philipp Nagele (Wikitude) Wikitude SDK Tutorial Philipp Nagele (Wikitude) Wikitude SDK Tutorial
Philipp Nagele (Wikitude) Wikitude SDK Tutorial AugmentedWorldExpo
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
sdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicsdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicRick Lau
 
Minko stage3d 20130222
Minko stage3d 20130222Minko stage3d 20130222
Minko stage3d 20130222Minko3D
 
Paug paris 2011
Paug paris 2011Paug paris 2011
Paug paris 2011sekond0
 
Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008Ryan Chou
 
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK AugmentedWorldExpo
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Prabindh Sundareson
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Codemotion
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 

Ähnlich wie 426 lecture6a osgART Development (20)

COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer Tools
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
 
Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with Wikitude
 
FLAR Workflow
FLAR WorkflowFLAR Workflow
FLAR Workflow
 
Philipp Nagele (Wikitude) Wikitude SDK Tutorial
Philipp Nagele (Wikitude) Wikitude SDK Tutorial Philipp Nagele (Wikitude) Wikitude SDK Tutorial
Philipp Nagele (Wikitude) Wikitude SDK Tutorial
 
Alexey Savchenko, Unreal Engine
Alexey Savchenko, Unreal EngineAlexey Savchenko, Unreal Engine
Alexey Savchenko, Unreal Engine
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
sdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicsdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_public
 
ARE 2011 AR Authoring
ARE 2011 AR AuthoringARE 2011 AR Authoring
ARE 2011 AR Authoring
 
Minko stage3d 20130222
Minko stage3d 20130222Minko stage3d 20130222
Minko stage3d 20130222
 
Paug paris 2011
Paug paris 2011Paug paris 2011
Paug paris 2011
 
Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008Introduction to Skia by Ryan Chou @20141008
Introduction to Skia by Ryan Chou @20141008
 
Task 2
Task 2Task 2
Task 2
 
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
Hacking for salone: drone races
Hacking for salone: drone racesHacking for salone: drone races
Hacking for salone: drone races
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 

Mehr von Mark Billinghurst

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Future Research Directions for Augmented Reality
Future Research Directions for Augmented RealityFuture Research Directions for Augmented Reality
Future Research Directions for Augmented RealityMark Billinghurst
 
Evaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesEvaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesMark Billinghurst
 
Empathic Computing: Delivering the Potential of the Metaverse
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
 
Empathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the MetaverseEmpathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the MetaverseMark Billinghurst
 
Talk to Me: Using Virtual Avatars to Improve Remote Collaboration
Talk to Me: Using Virtual Avatars to Improve Remote CollaborationTalk to Me: Using Virtual Avatars to Improve Remote Collaboration
Talk to Me: Using Virtual Avatars to Improve Remote CollaborationMark Billinghurst
 
Empathic Computing: Designing for the Broader Metaverse
Empathic Computing: Designing for the Broader MetaverseEmpathic Computing: Designing for the Broader Metaverse
Empathic Computing: Designing for the Broader MetaverseMark Billinghurst
 
2022 COMP 4010 Lecture 7: Introduction to VR
2022 COMP 4010 Lecture 7: Introduction to VR2022 COMP 4010 Lecture 7: Introduction to VR
2022 COMP 4010 Lecture 7: Introduction to VRMark Billinghurst
 
2022 COMP4010 Lecture 6: Designing AR Systems
2022 COMP4010 Lecture 6: Designing AR Systems2022 COMP4010 Lecture 6: Designing AR Systems
2022 COMP4010 Lecture 6: Designing AR SystemsMark Billinghurst
 
Novel Interfaces for AR Systems
Novel Interfaces for AR SystemsNovel Interfaces for AR Systems
Novel Interfaces for AR SystemsMark Billinghurst
 
2022 COMP4010 Lecture5: AR Prototyping
2022 COMP4010 Lecture5: AR Prototyping2022 COMP4010 Lecture5: AR Prototyping
2022 COMP4010 Lecture5: AR PrototypingMark Billinghurst
 
2022 COMP4010 Lecture4: AR Interaction
2022 COMP4010 Lecture4: AR Interaction2022 COMP4010 Lecture4: AR Interaction
2022 COMP4010 Lecture4: AR InteractionMark Billinghurst
 
2022 COMP4010 Lecture3: AR Technology
2022 COMP4010 Lecture3: AR Technology2022 COMP4010 Lecture3: AR Technology
2022 COMP4010 Lecture3: AR TechnologyMark Billinghurst
 
2022 COMP4010 Lecture2: Perception
2022 COMP4010 Lecture2: Perception2022 COMP4010 Lecture2: Perception
2022 COMP4010 Lecture2: PerceptionMark Billinghurst
 
2022 COMP4010 Lecture1: Introduction to XR
2022 COMP4010 Lecture1: Introduction to XR2022 COMP4010 Lecture1: Introduction to XR
2022 COMP4010 Lecture1: Introduction to XRMark Billinghurst
 
Empathic Computing and Collaborative Immersive Analytics
Empathic Computing and Collaborative Immersive AnalyticsEmpathic Computing and Collaborative Immersive Analytics
Empathic Computing and Collaborative Immersive AnalyticsMark Billinghurst
 
Empathic Computing: Developing for the Whole Metaverse
Empathic Computing: Developing for the Whole MetaverseEmpathic Computing: Developing for the Whole Metaverse
Empathic Computing: Developing for the Whole MetaverseMark Billinghurst
 

Mehr von Mark Billinghurst (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Future Research Directions for Augmented Reality
Future Research Directions for Augmented RealityFuture Research Directions for Augmented Reality
Future Research Directions for Augmented Reality
 
Evaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesEvaluation Methods for Social XR Experiences
Evaluation Methods for Social XR Experiences
 
Empathic Computing: Delivering the Potential of the Metaverse
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
 
Empathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the MetaverseEmpathic Computing: Capturing the Potential of the Metaverse
Empathic Computing: Capturing the Potential of the Metaverse
 
Talk to Me: Using Virtual Avatars to Improve Remote Collaboration
Talk to Me: Using Virtual Avatars to Improve Remote CollaborationTalk to Me: Using Virtual Avatars to Improve Remote Collaboration
Talk to Me: Using Virtual Avatars to Improve Remote Collaboration
 
Empathic Computing: Designing for the Broader Metaverse
Empathic Computing: Designing for the Broader MetaverseEmpathic Computing: Designing for the Broader Metaverse
Empathic Computing: Designing for the Broader Metaverse
 
2022 COMP 4010 Lecture 7: Introduction to VR
2022 COMP 4010 Lecture 7: Introduction to VR2022 COMP 4010 Lecture 7: Introduction to VR
2022 COMP 4010 Lecture 7: Introduction to VR
 
2022 COMP4010 Lecture 6: Designing AR Systems
2022 COMP4010 Lecture 6: Designing AR Systems2022 COMP4010 Lecture 6: Designing AR Systems
2022 COMP4010 Lecture 6: Designing AR Systems
 
ISS2022 Keynote
ISS2022 KeynoteISS2022 Keynote
ISS2022 Keynote
 
Novel Interfaces for AR Systems
Novel Interfaces for AR SystemsNovel Interfaces for AR Systems
Novel Interfaces for AR Systems
 
2022 COMP4010 Lecture5: AR Prototyping
2022 COMP4010 Lecture5: AR Prototyping2022 COMP4010 Lecture5: AR Prototyping
2022 COMP4010 Lecture5: AR Prototyping
 
2022 COMP4010 Lecture4: AR Interaction
2022 COMP4010 Lecture4: AR Interaction2022 COMP4010 Lecture4: AR Interaction
2022 COMP4010 Lecture4: AR Interaction
 
2022 COMP4010 Lecture3: AR Technology
2022 COMP4010 Lecture3: AR Technology2022 COMP4010 Lecture3: AR Technology
2022 COMP4010 Lecture3: AR Technology
 
2022 COMP4010 Lecture2: Perception
2022 COMP4010 Lecture2: Perception2022 COMP4010 Lecture2: Perception
2022 COMP4010 Lecture2: Perception
 
2022 COMP4010 Lecture1: Introduction to XR
2022 COMP4010 Lecture1: Introduction to XR2022 COMP4010 Lecture1: Introduction to XR
2022 COMP4010 Lecture1: Introduction to XR
 
Empathic Computing and Collaborative Immersive Analytics
Empathic Computing and Collaborative Immersive AnalyticsEmpathic Computing and Collaborative Immersive Analytics
Empathic Computing and Collaborative Immersive Analytics
 
Metaverse Learning
Metaverse LearningMetaverse Learning
Metaverse Learning
 
Empathic Computing: Developing for the Whole Metaverse
Empathic Computing: Developing for the Whole MetaverseEmpathic Computing: Developing for the Whole Metaverse
Empathic Computing: Developing for the Whole Metaverse
 

Kürzlich hochgeladen

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Kürzlich hochgeladen (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

426 lecture6a osgART Development

  • 1. COSC 426: Augmented Reality Mark Billinghurst mark.billinghurst@hitlabnz.org August 14th 2012 Lecture 6: osgART
  • 2. osgART Developing Augmented Reality Applications with osgART
  • 3. What is a Scene Graph?   Tree-like structure for organising a virtual world   e.g. VRML   Hierarchy of nodes that define:   Groups (and Switches, Sequences etc…)   Transformations   Projections   Geometry   …   And states and attributes that define:   Materials and textures   Lighting and blending   …
  • 5. Benefits of a Scene Graph   Performance   Structuring data facilitates optimization -  Culling, state management, etc…   Abstraction   Underlying graphics pipeline is hidden   Low-level programming (“how do I display this?”) replaced with high-level concepts Image: sgi (“what do I want to display?”)
  • 6. About Open Scene Graph   http://www.openscenegraph.org/   Open-source scene graph implementation   Based on OpenGL   Object-oriented C++ following design pattern principles   Used for simulation, games, research, and industrial projects   Active development community   Maintained by Robert Osfield   ~2000 mailing list subscribers   Documentation project: www.osgbooks.com   Uses the OSG Public License (similar to LGPL)
  • 7. About Open Scene Graph (2) Pirates of the XXI Century Flightgear SCANeR 3DVRII Research Institute EOR VRlab Umeå University
  • 8. Open Scene Graph Features   Plugins for loading and saving   3D: 3D Studio (.3ds), OpenFlight (.flt), Wavefront (.obj)…   2D: .png, .jpg, .bmp, QuickTime movies   NodeKits to extend functionality   e.g. osgShadow   Cross-platform support for:   Window management (osgViewer)   Threading (OpenThreads)
  • 9. Open Scene Graph Architecture Inter-operability with other environments, e.g. Python Plugins read and NodeKits extend write 2D image and core functionality, 3D model files Scene graph and exposing higher-level rendering node types functionality
  • 10. Some Open Scene Graph Demos osgviewer osgmotionblur osgparticle osgreflect osgdistortion osgfxbrowser   You may want to get the OSG data package:   Via SVN: http://www.openscenegraph.org/svn/osg/OpenSceneGraph-Data/trunk
  • 11. Learning OSG   Check out the Quick Start Guide   Free PDF download at http://osgbooks.com/, Physical copy $13US   Join the mailing list: http://www.openscenegraph.org/projects/osg/wiki/ MailingLists   Browse the website: http://www.openscenegraph.org/projects/osg   Use the forum: http://forum.openscenegraph.org   Study the examples   Read the source? 
  • 13. What is osgART?   osgART adds AR to Open Scene Graph   Further developed and enhanced by:   Julian Looser   Hartmut Seichter   Raphael Grasset   Current version 2.0, Open Source   http://www.osgart.org
  • 14. osgART Approach: Basic Scene Graph Root [ ] 0.988 -0.031 -0.145 0 -0.048 0.857 -0.512 0 Transform 0.141 0.513 0.846 10.939 29.859 -226.733 0 1   To add Video see-through AR: 3D Object   Integrate live video   Apply correct projection matrix   Update tracked transformations in realtime
  • 15. osgART Approach: AR Scene Graph Root Transform 3D Object
  • 16. osgART Approach: AR Scene Graph Root Virtual Camera Video Transform Layer Video 3D Object Geode
  • 17. osgART Approach: AR Scene Graph Root Projection matrix from tracker calibration Orthographic Transformation matrix projection Virtual updated from marker Camera tracking in realtime Video Transform Layer Full-screen quad with live texture updated from Video source Video 3D Object Geode
  • 18. osgART Approach: AR Scene Graph Root Projection matrix from tracker calibration Orthographic Transformation matrix projection Virtual updated from marker Camera tracking in realtime Video Transform Layer Full-screen quad with live texture updated from Video source Video 3D Object Geode
  • 19. osgART Architecture   Like any video see-through AR library, osgART requires video input and tracking capabilities. Video Source e.g. DirectShow AR Library Application Tracking Module (libAR.lib)
  • 20. osgART Architecture   osgART uses a plugin architecture so that video sources and tracking technologies can be plugged in as necessary OpenCVVideo - VidCapture - CMU1394 - PointGrey SDK - VidereDesign - Video Plugin VideoWrapper - VideoInput - VideoSource - Application DSVL - osgART Intranel RTSP - Tracker Plugin ARToolKit4 - ARToolkitPlus - MXRToolKit - ARLib - bazAR (work in progress) - ARTag (work in progress) -
  • 21. Basic osgART Tutorial   Develop a working osgART application from scratch.   Use ARToolKit 2.72 library for tracking and video capture
  • 22. osgART Tutorial 1: Basic OSG Viewer   Start with the standard Open Scene Graph Viewer   We will modify this to do AR!
  • 23. osgART Tutorial 1: Basic OSG Viewer   The basic osgViewer… #include <osgViewer/Viewer> #include <osgViewer/ViewerEventHandlers> int main(int argc, char* argv[]) { // Create a viewer osgViewer::Viewer viewer; // Create a root node osg::ref_ptr<osg::Group> root = new osg::Group; // Attach root node to the viewer viewer.setSceneData(root.get()); // Add relevant event handlers to the viewer viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.addEventHandler(new osgViewer::ThreadingHandler); viewer.addEventHandler(new osgViewer::HelpHandler); // Run the viewer and exit the program when the viewer is closed return viewer.run(); }
  • 24. osgART Tutorial 2: Adding Video   Add a video plugin   Load, configure, start video capture…   Add a video background   Create, link to video, add to scene-graph
  • 25. osgART Tutorial 2: Adding Video   New code to load and configure a Video Plugin: // Preload the video and tracker int _video_id = osgART::PluginManager::getInstance()- >load("osgart_video_artoolkit2"); // Load a video plugin. osg::ref_ptr<osgART::Video> video = dynamic_cast<osgART::Video*>(osgART::PluginManager::getInstance()- >get(_video_id)); // Check if an instance of the video stream could be created if (!video.valid()) { // Without video an AR application can not work. Quit if none found. osg::notify(osg::FATAL) << "Could not initialize video plugin!" << std::endl; exit(-1); } // Open the video. This will not yet start the video stream but will // get information about the format of the video which is essential // for the connected tracker. video->open();
  • 26. osgART Tutorial 2: Adding Video   New code to add a live video background osg::Group* createImageBackground(osg::Image* video) { osgART::VideoLayer* _layer = new osgART::VideoLayer(); _layer->setSize(*video); osgART::VideoGeode* _geode = new osgART::VideoGeode(osgART::VideoGeode::USE_TEXTURE_2D, video); addTexturedQuad(*_geode, video->s(), video->t()); _layer->addChild(_geode); return _layer; }   In the main function… osg::ref_ptr<osg::Group> videoBackground = createImageBackground(video.get()); videoBackground->getOrCreateStateSet()->setRenderBinDetails(0, "RenderBin"); root->addChild(videoBackground.get()); video->start();
  • 27. osgART Tutorial 3: Tracking   Add a Tracker plugin   Load, configure, link to video   Add a Marker to track   Load, activate   Tracked node   Create, link with marker via tracking callbacks   Print out the tracking data
  • 28. osgART Tutorial 3: Tracking   Load a tracking plugin and associate it with the video plugin int _tracker_id = osgART::PluginManager::getInstance()->load("osgart_tracker_artoolkit2"); osg::ref_ptr<osgART::Tracker> tracker = dynamic_cast<osgART::Tracker*>(osgART::PluginManager::getInstance()->get(_tracker_id)); if (!tracker.valid()) { // Without tracker an AR application can not work. Quit if none found. osg::notify(osg::FATAL) << "Could not initialize tracker plugin!" << std::endl; exit(-1); } // get the tracker calibration object osg::ref_ptr<osgART::Calibration> calibration = tracker->getOrCreateCalibration(); // load a calibration file if (!calibration->load("data/camera_para.dat")) { // the calibration file was non-existing or couldnt be loaded osg::notify(osg::FATAL) << "Non existing or incompatible calibration file" << std::endl; exit(-1); } // set the image source for the tracker tracker->setImage(video.get()); osgART::TrackerCallback::addOrSet(root.get(), tracker.get()); // create the virtual camera and add it to the scene osg::ref_ptr<osg::Camera> cam = calibration->createCamera(); root->addChild(cam.get());
  • 29. osgART Tutorial 3: Tracking   Load a marker and activate it   Associate it with a transformation node (via event callbacks)   Add the transformation node to the virtual camera node osg::ref_ptr<osgART::Marker> marker = tracker->addMarker("single;data/patt.hiro;80;0;0"); if (!marker.valid()) { // Without marker an AR application can not work. Quit if none found. osg::notify(osg::FATAL) << "Could not add marker!" << std::endl; exit(-1); } marker->setActive(true); osg::ref_ptr<osg::MatrixTransform> arTransform = new osg::MatrixTransform(); osgART::attachDefaultEventCallbacks(arTransform.get(), marker.get()); cam->addChild(arTransform.get());   Add a debug callback to print out information about the tracked marker osgART::addEventCallback(arTransform.get(), new osgART::MarkerDebugCallback(marker.get()));
  • 30. osgART Tutorial 3: Tracking   Tracking information is output to console
  • 31. osgART Tutorial 4: Adding Content   Now put the tracking data to use!   Add content to the tracked transform   Basic cube code arTransform->addChild(osgART::testCube()); arTransform->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin");
  • 32. osgART Tutorial 5: Adding 3D Model   Open Scene Graph can load some 3D formats directly:   e.g. Wavefront (.obj), OpenFlight (.flt), 3D Studio (.3ds), COLLADA   Others need to be converted   Support for some formats is much better than others   e.g. OpenFlight good, 3ds hit and miss.   Recommend native .osg and .ive formats   .osg – ASCII representation of scene graph   .ive – Binary OSG file. Can contain hold textures.   osgExp : Exporter for 3DS Max is a good choice   http://sourceforge.net/projects/osgmaxexp   Otherwise .3ds files from TurboSquid can work
  • 33. osgART Tutorial 5: Adding 3D Model   Replace the simple cube with a 3D model   Models are loaded using the osgDB::readNodeFile() function std::string filename = "media/hollow_cube.osg"; arTransform->addChild(osgDB::readNodeFile(filename)); Export to .osg 3D Studio Max osgART   Note: Scale is important. Units are in mm.
  • 34. osgART Tutorial 6: Multiple Markers   Repeat the process so far to track more than one marker simultaneously
  • 35. osgART Tutorial 6: Multiple Markers   Repeat the process so far to track more than one marker   Load and activate two markers osg::ref_ptr<osgART::Marker> markerA = tracker->addMarker("single;data/patt.hiro;80;0;0"); markerA->setActive(true); osg::ref_ptr<osgART::Marker> markerB = tracker->addMarker("single;data/patt.kanji;80;0;0"); markerB->setActive(true);   Create two transformations, attach callbacks, and add models osg::ref_ptr<osg::MatrixTransform> arTransformA = new osg::MatrixTransform(); osgART::attachDefaultEventCallbacks(arTransformA.get(), markerA.get()); arTransformA->addChild(osgDB::readNodeFile("media/hitl_logo.osg")); arTransformA->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin"); cam->addChild(arTransformA.get()); osg::ref_ptr<osg::MatrixTransform> arTransformB = new osg::MatrixTransform(); osgART::attachDefaultEventCallbacks(arTransformB.get(), markerB.get()); arTransformB->addChild(osgDB::readNodeFile("media/gist_logo.osg")); arTransformB->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin"); cam->addChild(arTransformB.get());
  • 36. osgART Tutorial 6: Multiple Markers
  • 37. Basic osgART Tutorial: Summary Standard OSG Viewer Addition of Video Addition of Tracking Addition of basic 3D Addition of 3D Model Multiple Markers graphics
  • 39. FLARManager:   Makes building FLARToolkit apps easier   Is open-source, with a free and commercial license   Is designed to allow exploration of both augmented reality and alternative controllers   Decouples FLARToolkit from Papervision3D   Configuration without recompilation, via xml config
  • 40. FLARManager: features   Gives more control over application environment   Provides multiple input options   Robust multiple marker management   Supports multiple 3D frameworks   Offers features for optimization   Allows for customization
  • 42. Websites   Software Download   http://artoolkit.sourceforge.net/   ARToolKit Documentation   http://www.hitl.washington.edu/artoolkit/   ARToolKit Forum   https://www.artoolworks.com/community/forum/   ARToolworks Inc   http://www.artoolworks.com/
  • 43.   ARToolKit Plus   http://studierstube.icg.tu-graz.ac.at/handheld_ar/ artoolkitplus.php   osgART   http://www.osgart.org/   FLARToolKit   http://www.libspark.org/wiki/saqoosha/FLARToolKit/   FLARManager   http://words.transmote.com/wp/flarmanager/
  • 44. Books   Interactive Environments with Open-Source Software: 3D Walkthroughs and Augmented Reality for Architects with Blender 2.43, DART 3.0 and ARToolKit 2.72 by Wolfgang Höhl   A Hitchhikers Guide to Virtual Reality by Karen McMenemy and Stuart Ferguson
  • 45. More Information •  Mark Billinghurst –  mark.billinghurst@hitlabnz.org •  Websites –  www.hitlabnz.org