Re: [osg-users] Change for need to redraw scene
Hi Filip, Am 02.12.2011 12:39, schrieb Filip Arlet: > If you want redraw on demand exactly. > Code: > > if( viewer->checkNeedToDoFrame() ) > { > viewer->frame(); > } I will try this and keep you updated. > Btw. comparing two matrices of doubles has to be done with epsilon delta of course, how could I forget...should have known this. Thank you Hartmut -- Hartmut Leister 04317 Leipzig ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Change for need to redraw scene
Hi, for redrawing, call function requestRedraw() on View(er) you want to redraw. I suppose you are changing the scene by yourself. If you want redraw on demand, other than calling frame by yourself use osgViewer::Viewerbase::setRunFrameScheme(ON_DEMAND); In QtViewer example there's QTimer for redrawing, but it calls frame() every tick. If you want redraw on demand, see fuction osgQt::setViewer() or use this: Code: if( viewer->checkNeedToDoFrame() ) { viewer->frame(); } Btw. comparing two matrices of doubles has to be done with epsilon delta, because of precision problems. Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44187#44187 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Change for need to redraw scene
Hello OSG-Users, (I'm writing a display application, using osgviewerQt) I'm looking for a way to check, whether I need to redraw the scene to skip a redraw, if would be the same as the previous (fixed image). Or is this already done by osg-library? I figured, I only need a redraw, if a) Camera changes (position, field of view) b) scene changes (geometry changes, color changes) Unfortunately my first guesses and web searches were not successful, e.g. I saved the cameras ViewMatrix ( getCamera()->getViewMatrix() ) after a call of frame() to compare it to the current before the next call of frame(). Oddly the seem to change every time, even though the Viewer showed a fixed image. Can anyone point me to a direction and offer hints, to how I can achieve this? Am I carrying coals to Newcastle, since OSG would already be doing this and/or I only forgot to set a flag? Thanks in advance and sunny greetings Hartmut -- frag nicht - du könntest eine antwort erhalten NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org