Sign in to follow this  
tonyoto

Scene editors, graphs and widgets

Recommended Posts

Hi, So I have made this little engine with a scene graph and some scene nodes and I'm testing it with a simple editor. So far it's mostly been picking and rotating basic meshes but now I'm implementing shading, lights and effect nodes which raises a question. These types of objects do not have a natural representation in the scene graph like a mesh does and thus I can't see, pick or move them with the mouse pointer. Of course, like in any other 3D editor I need some kind of widget to represent these objects. On one hand it would be so easy to implement them as scene nodes and insert them directly into the scene graph as a parent node so that when moved it automatically moves its child nodes. On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene. Because of this, maybe it's better to store them separately from the graph. Any ideas? How do people usually do this?

Share this post


Link to post
Share on other sites
Quote:
Original post by tonyoto
On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene.

Why not? Surely shading and lighting are important in defining the look and feel of a scene. Throwing that information away when you save and load doesn't seem like a good idea to me.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
Quote:
Original post by tonyoto
On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene.

Why not? Surely shading and lighting are important in defining the look and feel of a scene. Throwing that information away when you save and load doesn't seem like a good idea to me.


Sorry if I was unclear. I'm not talking about the lights themselves but the often simple cones, spheres, rhombi or such that might be representing them in a 3D editor only as a visual aid. Surely it must be unnecessary to save them with the scene.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I don't understand why you think lights should not be in the scene graph. I add lights to my scene graph so I can cull lights that are not effecting the scene. I would store the lights within the scene graph, and just have the editor fill in the widget to select them as it traverses the graph, you don't need to store the widget geometry in the graph, just the light properties.

As far as shader and effect nodes, that depends. I would define shaders as a property of the objects in the scene graph. As far as effect nodes, it depends on what you mean by effects. Certain effects can easily be placed as a node in the graph. If you need an object to rotate around a parent, place an effect node between the parent and object. A better solution may be to use a decorator pattern for the effects, and apply the decorator to the node.

Just my opinion.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this