Re: [osg-users] Object oriented coding
Thank you. I will check it out. Can you please edit the replies and remove my name and email? I have chosen the settings not to publish name and email, but they still appear just before quoted text it seems. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9597#9597 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Object oriented coding
Thanks for the reply. That's an interesting article. It does make sense when thinking about it, although the object oriented stucture is deeply rooted in many programmers' heads (mine included) :) Anyway, I think my question applies to objects and components alike... How does adding data to the scene graph (and drawing it) fit in to objects and components? Staying with object thinking for a while, do people generally create an AddToSceneGraph() member function for sub objects that are to be rendered? With this approach I suppose there is no Draw() member function in sub objects, as this does not go along with drawing the entire scene graph once every frame. Am I right? I know I should probably read some good literature on this, but for now I just want to test the concept and get a not-in-depth general understanding. Is there any small example out there using an object oriented approach together with real OSG code? I know this must sound like a real newbie question, but when it comes to games and scene graphs I'm still a newbie :) By the way, is there a way for me to not publish name and email in this forum? I saw that it is included near the quoted text in the reply. I don't make good friends with spammers :? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9542#9542 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Object oriented coding
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