Hi Jeremy, I really agree with Jean-Sébastien. The main difference is that he seems to know more about OSG than me! I just have to tell "That's just what I wanted to say!"...
Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Tue, 25 Nov 2008 05:22:47 +0100, Jean-Sébastien Guay <[EMAIL PROTECTED]> a écrit: > Hi Jeremy, > >> Why does the WindowManager have to know anything about cameras? > > I have the same question, but with different results: unless I've missed > something in your description, why does anyone need to know about the > camera? If you get your click events (which you act upon to get > intersections) through an event handler, then you can just get an > osg::View* with aa.asView(), which then has a camera. No one really > needs to hold on to a camera pointer. > > I would definitely go with calculating intersections directly through > osgUtil::IntersectionVisitor. You can use the constructor that takes one > of the WINDOW, PROJECTION, VIEW and MODEL enum values to easily > construct the right intersector. It should even work for 3D "widgets in > space... space ... space ..." :-) > > As for creating an ortho viewport, perhaps you can return an osg::Camera > with the right setup, and the user can then assign that to their > viewer/view/slave camera/scenegraph/whatever. It would be more general. > > That way you can remove the dependency between osgWidget and osgViewer > (not sure if that's the goal here, but if intersections was the only > thing that forced that dependency, I'd definitely remove it). > > Anyways, like the others who replied I don't really know the internals > of osgWidget, so perhaps there's something I've overlooked, but that's > how I see it at first glance. > > Hope this helps, > > J-S _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

