Hi Anders, On 8/3/07, Anders Backman <[EMAIL PROTECTED]> wrote: > Two things of which the first is of higher priority... > > 1. To make the ModelView matrix match the osg definition (z-up) how > would you recommend that I calculate the modelview assuming that only > the Camera is known in a preDrawCallback, just so that I don't make > any assumptions that can later be changed in some other part of the > system?
The OSG us of z up is merely a convention used by the camera manipulators and the loaders, the view matrix itself encodes this for you, there isn't any other matrix added in behind the scenes by the OSG, so its exactly what is passed to OpenGL. So... I would have though just passing the view matrix as is would the appropriate thing to do. > I can get the ViewMatrix, I can also get the MatrixList (of all > matrices above the camera in the scenegraph), but to match osg and to > make it as flexible as the rest of osg, how would do this? With Viewer cameras there aren't any nodes above it so this should just be an empty lists. > 2. Regarding GraphicsContext, assume that I do need access to a > graphicsContext in a PreRender, how can I take control of that Context > avoiding any race condition? > Now, Im not sure where I get the hang, but it does have something to > do with the fact that Im accessing OpenGL when I should not... > Eventhough, when I get into the PreRender callback the Context is > active. so a simple makeCurrent() would not work. The Camera pre draw callback will have the graphics context already made current so there won't be any need to call makeCurrent yourself. If you are finding problems doing OpenGL calls in a Camera pre or post draw callback then there must be something else wider that is amiss - the OSG itself should be having the same problems too. As for hangs or race conditions on your own code, I can't really comment. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

