osgART 2.0 RC3 with OpenSceneGraph 2.9.7 or later (including 3.0.0)

Long time ago I had problems using osgART 2.0 RC3 with OpenSceneGraph 2.9.7 or later, I couldn’t get the video feed from the webcam on the background so I only used OpenSceneGraph 2.9.6. Today I found out that my osgART program could work with OpenSceneGraph 2.9.7 or later (current version 3.0.0 works too!), but as I always used 2.9.6 I didn’t know I have founded the solution to this problem!

NOTE: If you want to install OpenSceneGraph 3.0.0 in Ubuntu 11.10 or Ubuntu 12.04 you’ll have to use the patches I’ve created and uploaded to my github repository.

The key of the problem is that when you configure the video backgrounds osgART::VideoGeode you can use TEXTURE_2D or TEXTURE_RECTANGLE. If you use TEXTURE_RECTANGLE it will work on newer versions of OpenSceneGraph. You can look at line 40 of “examples/osgartsimple/osgartsimple.cpp” in osgART 2.0 RC3 source code folder:

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;
}

If you installed OpenSceneGraph 2.9.7 or later and compiled osgART 2.0 RC3 as it comes in the original code, when you execute this example from “/usr/local/bin/osgartsimple” you will get this as you show the “Hiro” pattern to the camera:

If you change previous code this way:

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_RECTANGLE, video);
        addTexturedQuad(*_geode,video->s(),video->t());
        _layer->addChild(_geode);
        return _layer;
}

Then compile and install osgART 2.0 RC3 again, “/usr/local/bin/osgartsimple” will work OK.

You might also like

Install OpenSceneGraph 2.9.6 with Collada support in Ubuntu 12.04
Although I usually install OpenSceneGraph 2.8.3 to work with osgART 2.0 RC3 it is also posible to use...
Install osgART 2.0 RC3 with OpenSceneGraph 2.8.3 or 2.9.6 with Collada support in Ubuntu 12.04
Before installing osgART we need to install ARToolKit, collada-dom and OpenSceneGraph so look at those...
Install OpenSceneGraph 2.8.3 with Collada support in Ubuntu 12.04
We are going to install OpenSceneGraph 2.8.3 (for now on OSG) to use it with osgART 2.0 RC3. As far as...
ARSlides v1.0: Augmented Reality slide presentation application
I'm glad to inform that I've (finally) published the code for the Augmented Reality application I've...
Leave a comment ?

4 Comments.

  1. Really Cool.Osgart 2.0 with OSG 3.0 works on my PC.However, every time when I show the demo, it comes out a tip like “Warning: detected OpenGL error ‘invalid enumerant’ at After Renderer::compile”,I don’t know whether it has influence in some way. DO you have the same warning there? and How to deal with it.Thanks in advance.

    Reply

Leave a Comment