You're welcome
Thanks Sebastian. That was it. It did helped!
Nick
On Thu, Dec 19, 2013 at 11:53 AM, Trajce Nikolov NICK
<trajce.nikolov.n...@gmail.com <mailto:trajce.nikolov.n...@gmail.com>>
wrote:
Hi Sebastian,
that is actually a good idea to do the traversal first. Let me try
it first. Thanks !
Nick
On Thu, Dec 19, 2013 at 11:51 AM, Sebastian Messerschmidt
<sebastian.messerschm...@gmx.de
<mailto:sebastian.messerschm...@gmx.de>> wrote:
Am 19.12.2013 09:26, schrieb Trajce Nikolov NICK:
Hi Nick,
My first question would be: Why don't you simply attach the
windshield to the model ;-)
No seriously, I had those effects too, when retrieving e.g.
the ModelView matrix in callbacks. The problem usually was
gone whe doing the traverse first and the get the matrices.
Maybe you can give it a try, or paste some of your
update-callback code here, so we can help.
So basically this:
void CameraUpdateCallback::operator()( osg::Node* node,
osg::NodeVisitor* nv )
{
osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*>(nv);
if (!cv)
{
return;
}
traverse(node,nv);
osg::Camera& camera =
*cv->getRenderInfo().getView()->getCamera();
camera.getViewMatrix() ....
}
will yield different results than this:
void CameraUpdateCallback::operator()( osg::Node* node,
osg::NodeVisitor* nv )
{
osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*>(nv);
if (!cv)
{
return;
}
osg::Camera& camera =
*cv->getRenderInfo().getView()->getCamera();
camera.getViewMatrix() ....
traverse(node,nv);
}
This at least solved problems in multipass-rendering, where
multiple cameras had to be synced relative to each other.
Hope this helps.
cheers
Sebastian
Hi Community,
I have a simple scene of a car model with a windshield (two
separate models combined in runtime). There is
osg::MatrixTransform node on top of the car that moves it
around, and the windshield is attached to the scene that also
has osg::MatrixTransform on top of it with an UpdateCallback
that copies the car's matrix.
( the real scene is a bit different but this is the concept)
I am seeing the windshild has some delay in following the car
model while moving and at lower framerates. I think I just
tried everything but always this is the same case
Any clue and hints?
Thanks a bunch!
Nick
--
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
<mailto:osg-users@lists.openscenegraph.org>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
<mailto:osg-users@lists.openscenegraph.org>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
trajce nikolov nick
--
trajce nikolov nick
_______________________________________________
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