OpenSG Browser Plugin

June 29, 2009

Well the summer has finally arrived, and I’ve finally got around to publishing this on the research groups website.  It is a small application making use of the Qt4 browser-plugin API to provide an OpenSG canvas within a web browser.  It wouldn’t take much effort to make it easily installable for users.  (Just statically link the whole thing into a single binary I’m guessing)

The advantage of using OpenSG rather than OpenGL as a canvas for web3d graphics is that you can build upon the scenegraph, take all of it’s functioanltiy, rather than you worrying about creating file loaders etc.  The URL for the plugin is http://novellab.brighton.ac.uk/?q=projects/opensgplugin

P.S. If anyone is able to help me solve https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/389441 it’ll be great.

I’ve mentioned OpenSG on this blog.  It is a scene-graph based API I use at work for rendering of 3D scenes.  As part of these scenes you can create textures on these objects, which are basically pictures.  Well my co-worker, Karina, has produced some code for displaying video on these textures, which is really cool.

We’ve been playing around with video playing over our tiled wall cluster both playing just a video, or wrapping the video around an object such as a sphere.  We’ll be releasing the source code for it soon on our website along with some other cool things we’ve been producing.  But before hand I’d just like to show you a picture of it running the Big Buck Bunny video (which is cool project as well).

The OpenSG packages within Ubuntu Hardy don’t contain any of the contrib directory functionality been built.  These aren’t prebuilt due to them been work in progress or licensing issues.  The ply contribution is restricted due to it’s license to non commercial work only, so it needs to be built outside of the packages distributed.

Normally this would be built and stored within the libOSGSystem.so library, requiring the the library to be built again, which takes a while 🙂  So instead I’ll show you how to build it as a separate library for you to link against in your applications.

Within the directory containing the source code, the following command will build it as a shared library called libOSGPly.so.

g++ OSGply.cpp  OSGPLYSceneFileType.cpp -I/usr/include/OpenSG/ `pkg-config OSGSystem
 --libs --cflags` -shared -fPIC -o libOSGPly.so

This then needs to be copied to your system path so the linker can find it, so:

sudo cp libOSGPly.so /usr/lib/.

The header files then require installation, so:

sudo cp *.h /usr/include/OpenSG/.

Now all you need to do is add -lOSGPly to your linker options to use the library.

I’m sure the same trick can be used with the other contrib features if you wish to enable them easily.

The way which I was originally shown to build new nodes for OpenSG involved using the existing OpenSG build system. It usually existed of these steps

  • Putting your node code into the source dir (I can’t remember which one)
  • Re-running configure for it to be copyied to the build dir
  • Use make and sudo make install to rebuild OpenSG and re install it all

Of course if your installing binaries from the repo’s you don’t want to be doing this. Instead you’ll need something like the following to build and link against the binaries. (with the -dev packages installed)

g++ -I`pwd` -I/usr/include/OpenSG `pkg-config OSGBase --cflags --libs` `pkg-config OSGSystem --cflags --libs` -shared -fPIC *.cpp -o libOSG<nodename>

Of course you’ll need to link against other libraries if you need them.

The compiled library can then just be copied into /usr/lib and you can start using it. The above build command can easily be broken down to work with autotools as well, allowing your new node to built on other distros which make use of pkg-config and have installed to different paths.

OpenSG Packages for Ubuntu

October 19, 2007

UPDATE: Opensg has been accepted for the hardy release cycle and backports will be forthcoming hopefully.

Using the personal package archives over on launchpad I’ve created feisty and gutsy packages for OpenSG. The packages which are built are:

  • libopensg-core1 – Base and System libraries for users
  • libopensg-core-dev – Base and System libraries for developers
  • libopensg-qt1 – WindowQT libraries for users
  • libopensg-qt-dev – WindowQT libraries for developers
  • libopensg-windowx1 – WindowX libraries for users
  • libopensg-windowx-dev – WindowX libraries for developers
  • libopensg-glut1 – WindowGLUT libraries for users
  • libopensg-glut-dev – WindowGLUT libraries for developers
  • opensg-tools – fcdEdit and actorEdit
  • libopensg-doc – User and developer docs

The scripts used to build it are in the source package so if you apt get them. A launchpad team has also been created to help manage the packages along with providing a team to assign bugs with the packages to when reporting them.

To install OpenSG you’ll first need to add the ppa your /etc/apt/sources.list file.

For Feisty Fawn :

deb http://ppa.launchpad.net/opensg/ubuntu feisty main restricted universe multiverse
deb-src http://ppa.launchpad.net/opensg/ubuntu feisty main restricted universe multiverse

For Gutsy Gibbon :

deb http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse
deb-src http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse