Non-technical Glib advise needed



Hi Gtk folks.

I've used a lot of 3D software on and off over the last 4 years, and although
I know I might never make a working 3D modeler (for a number of reasons),
that's what I'm trying to do now. I've been playing around with Gtk+ and
GtkGLExt for a while, and it seems to do what I need for a frontend, and
for scripting (which will probably be the primary way of controlling
objects in a scene for a while), I've found LUA (http://www.lua.org) to
fit my needs. What I'm looking for now is something to aid the managing of
the data structures within the scene. The internal representation of
objects, materials and lights should be something like a graph with
interconnected nodes (with their attributes). For example, like this:

          +-----------+
          | material1 |
          |  * colorR |
          |  * colorG |
          |  * colorB |
          |  * ...    |
          +-----------+
            |          \
            |           \
          +-----------+  +----------+
          | sphere1   |  | cube1    |
          |  * colorR |  | * colorR |
          |  * colorG |  | * colorG |
          |  * colorB |  | * colorB |
          |  * ...    |  | * ...    |
          +-----------+  +----------+

I hope you see what I mean here. The three attributes in the node
material1 will affect the three corresponding attributes in the two
nodes sphere1 and cube1. This is how a scene is represented in
Alias|Wavefront Maya, if anyone is familiar with that program, and there
it is called the Dependency Graph. I wish to do something similar for my
little modeler, although much less sophisticated. So, finally, my
question is: Is Glib a good choice as a library to build this kind of
data structure? I've read some about the Glib Object system at:

http://le-hacker.org/papers/gobject/index.html

but I thought I'd ask here, it's better to hear that what I'm thinking
is whack from someone on this list than finding it out the hard way.
Could the interconnections between the nodes be implemented using
signals? Is it a Good Idea(tm)?

I'm not a master programmer, that's why I'm asking. I hope I'm not
asking for too much. If I'm not clear enough, ask me, and I might be
able to clarify further what I want to do.

Best regards,
Aron Stansvik




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]