PDA

View Full Version : Simple scene graph library (or something similar)?



yesint
July 17th, 2009, 01:48 PM
Dear All,
I'm searching for some library to simplify the coding with OpenGL. I need something which will take care of sorting the transparent objects, picking with the mouse and the like. I examined OpenSceneGraph and OpenSG and found both very complicated and extremely confusing at first glance. There are probably some reasons why the APIs are so insanely complicated, but I really need something simpler.
Anyone know other good simple libraries of that kind (not necessary the full-blown scenegraph)?

moma
July 17th, 2009, 01:53 PM
Hello.

Clutter is what you are looking for.
http://www.clutter-project.org

Ubuntu has ready-made packages for it. Check:
$ aptitude search clutter

And there are some demos on the blog page... (http://www.clutter-project.org/blog/)

We stronly believe that Clutter will be part of the upcoming GNOME 3.0 desktop and GTK 3 toolkit. Google's Chrome OS will also use Clutter, AFAIK ;-)
----

EDIT: Maybe best you start with Clutter version 0.8. It seems to me that Clutter 9.0 is under development and its API fluctuates, therefore some examples will not compile under it yet.
My recommendation is this

1) Install Clutter version 0.8 from Ubuntus repo.
$ sudo aptitude install build-essential libclutter-0.8-dev libclutter-cairo-0.8-dev libclutter-gtk-0.8-dev

2) Browse to this tutorial and advance step by step
http://www.openismus.com/documents/clutter_tutorial/0.8/docs/tutorial/html/index.html

3)Learn to compile and link your code. Here is an example.

Download first the main.c and images/ directory with some images from
http://svn.o-hand.com/view/clutter/trunk/clutter-tutorial/examples/full_example/?rev=2925#dirlist

Compile and link the code
$ gcc -Wall -g `pkg-config clutter-0.8 clutter-gtk-0.8 --cflags --libs` main.c -o main

Then run it
$ ./main

You should have some images in the images/ directory.

4) Here is the API-reference for Clutter v0.8
http://www.clutter-project.org/docs/clutter/0.8/
----

Other examples

* The Intel's Moblin interface uses Clutter too. Take a look at the samples.
http://moblin.org/documentation/moblin-sdk/create-new-application

* This Pong game... (http://damino.ca/?p=106) uses Clutter + Cairo graphics. Use the "git clone..." command to download it.
Run "sh autogen.sh" to generate a configure + Makefile. Then compile with "make".
----

curvedinfinity
July 17th, 2009, 02:53 PM
Technically an "engine", but all of its components are optional.

http://irrlicht.sourceforge.net/

I've just used the scenegraph and model/texture loading before, and it worked great. Its very simple to use.

yesint
July 20th, 2009, 10:27 AM
Hello.

Clutter is what you are looking for.
http://www.clutter-project.org
----

I'm not that sure. As far as I understand Clutter is just an API for creating "2.5D" user interfaces, while I need full 3D scenes with materials, lighting, etc.

moma
July 20th, 2009, 12:49 PM
Ok, I understand. You are looking for a library with complete 3D capabilities.

Maybe you are better off with one of these... (http://ubuntuforums.org/showthread.php?p=3635764#post3635764) libs.
(SDL is a 2D library even it allows you to program in pure OpenGL too).

yesint
July 21st, 2009, 08:10 AM
Ok, I understand. You are looking for a library with complete 3D capabilities.

Maybe you are better off with one of these... (http://ubuntuforums.org/showthread.php?p=3635764#post3635764) libs.
(SDL is a 2D library even it allows you to program in pure OpenGL too).

Thank you for the link! I've made a quick look and panda looks really very nice. The only thing is that all these game engines are far too heavy for my task. After some critical study of my needs I see that the only thing, which I currently can't do in plain OpenGL is handling transparency (correct polygon sorting).