Hi Tomas, This is a software design question, not really an OpenSceneGraph one. I'd recommend reading articles/books on game/object oriented design. The design of your classes will depend on your application requirements, taking into account money/time/etc. constraints.
I'd recommend that your design abstract out rendering such that your OSG code is in separate rendering components. We do this in our visualization applications to allow us to switch renderers. We do this using a component based object management design (see http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/) and it has worked out really well. Good luck, - Donny On Wed, Apr 1, 2009 at 5:32 AM, Tomas Lundberg <tomas...@gmail.com> wrote: > Hi, > > I have done some small test projects for fun in OSG, without really > learning it correctly. Now I have a very general question: > > How do I structure my code to make it more object oriented together with > OSG? > > Let's say I want to visualise an airport with planes coming and leaving. I > would like to write this program in an object oriented manner, where the > airport has a number of planes, where each plane has a number of parts etc. > A plane should of course have properties such speed and engine thrust. Same > thing goes for parts of a plane. For instance a wing should have a number > that represents the drag, and also a number for its weight. It should also > have visual information (shape, position, material etc). > > How do I combine this visual information with non-visual information in an > object oriented manner? I guess visual information should go into the scene > graph where as the rest does not. Yet, I want all the information about the > wing to go into the same C++ wing object. Is there any good example showing > how to manage this? I would love to see simple code examples showing these > principles as they are easier to understand. > > Thank you. > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=9529#9529 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org