Re: [osg-users] osg::MatrixTransform delays
Hi Sebastian, when the particle system is frozen, then it is moving without delays. Otherwise I see still delays. Robert, any comment on this issue. It is sort of big for me Thanks a bunch! Nick On Fri, Dec 20, 2013 at 1:30 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, just one idea: Can you replace the particle system with something else. So maybe it is strictly particle system related. (I'm assuming, that you use osgParticle here) Hi Sebastian, You are right, that is the structure and the first thing I tried was to attach it directly to the body but then I saw this artifact like the particles following the model with delay. So I tried the update callback. Now I am thinking to have the particles attached to the main camera so they move with the view but here is again update callbacks and such. Thanks anyway ! Nick On Thu, Dec 19, 2013 at 9:35 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Am 19.12.2013 12:09, schrieb Trajce Nikolov NICK: Sebastian, it was too early to be happy. Changing it to traverse first then update didn't helped actually. On the windshield model I have attached ParticleSystem that is actually delayed with the windshield. Any other ideas? I also tried to attach this directly to parts of the model but same results. It is about rain effect. This particle system is firing rain drops on the windshield geometry and it suppose to move with the car model, however it is delayed as it moves. Sorry, I'm out of ideas here too. If I got you correctly you have some group which represents a body and another one representing the windshield with the particlesystem attached. And you are updating the later with the update-callback. I don't understand why the two groups must be disjoint. Can you explain the reason for this? Are those two different render passes? If you explain your structure a bit more in depth I maybe can point to an alternative solution. cheers Sebastian Thanks Nick On Thu, Dec 19, 2013 at 12:02 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: 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 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 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_castosgUtil::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_castosgUtil::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 listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick -- trajce nikolov nick ___
Re: [osg-users] osg::MatrixTransform delays
On 24 December 2013 11:54, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: when the particle system is frozen, then it is moving without delays. Otherwise I see still delays. Robert, any comment on this issue. It is sort of big for me It is almost certainly an order of operations issue, but can't say what exactly you are doing wrong or what to do about it. I would have commented already if I had any constructive ideas. Merry Christmas :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::MatrixTransform delays
ok. thanks. as I mentioned in my other post, it is a black box with plugin architecture allowing to plug osg code here and there, so it is not flexible. I tried everything and I think the particles are updated prior to the matrix that moves the entity, so it is always a bit ahead when it moves. I got confirmed by their support people that they have their own schema on updating models, so it is definitely not happening in the update traversal. Merry Christmas to you as well :-) Nick On Tue, Dec 24, 2013 at 3:24 PM, Robert Osfield robert.osfi...@gmail.comwrote: On 24 December 2013 11:54, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: when the particle system is frozen, then it is moving without delays. Otherwise I see still delays. Robert, any comment on this issue. It is sort of big for me It is almost certainly an order of operations issue, but can't say what exactly you are doing wrong or what to do about it. I would have commented already if I had any constructive ideas. Merry Christmas :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::MatrixTransform delays
Hi Nick, just one idea: Can you replace the particle system with something else. So maybe it is strictly particle system related. (I'm assuming, that you use osgParticle here) Hi Sebastian, You are right, that is the structure and the first thing I tried was to attach it directly to the body but then I saw this artifact like the particles following the model with delay. So I tried the update callback. Now I am thinking to have the particles attached to the main camera so they move with the view but here is again update callbacks and such. Thanks anyway ! Nick On Thu, Dec 19, 2013 at 9:35 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de mailto:sebastian.messerschm...@gmx.de wrote: Am 19.12.2013 12:09, schrieb Trajce Nikolov NICK: Sebastian, it was too early to be happy. Changing it to traverse first then update didn't helped actually. On the windshield model I have attached ParticleSystem that is actually delayed with the windshield. Any other ideas? I also tried to attach this directly to parts of the model but same results. It is about rain effect. This particle system is firing rain drops on the windshield geometry and it suppose to move with the car model, however it is delayed as it moves. Sorry, I'm out of ideas here too. If I got you correctly you have some group which represents a body and another one representing the windshield with the particlesystem attached. And you are updating the later with the update-callback. I don't understand why the two groups must be disjoint. Can you explain the reason for this? Are those two different render passes? If you explain your structure a bit more in depth I maybe can point to an alternative solution. cheers Sebastian Thanks Nick On Thu, Dec 19, 2013 at 12:02 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de mailto:sebastian.messerschm...@gmx.de wrote: 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_castosgUtil::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_castosgUtil::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
Re: [osg-users] osg::MatrixTransform delays
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_castosgUtil::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_castosgUtil::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 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
Re: [osg-users] osg::MatrixTransform delays
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 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_castosgUtil::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_castosgUtil::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 listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::MatrixTransform delays
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 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 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_castosgUtil::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_castosgUtil::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 listosg-users@lists.openscenegraph.orghttp://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 -- 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
Re: [osg-users] osg::MatrixTransform delays
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_castosgUtil::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_castosgUtil::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
Re: [osg-users] osg::MatrixTransform delays
Sebastian, it was too early to be happy. Changing it to traverse first then update didn't helped actually. On the windshield model I have attached ParticleSystem that is actually delayed with the windshield. Any other ideas? I also tried to attach this directly to parts of the model but same results. It is about rain effect. This particle system is firing rain drops on the windshield geometry and it suppose to move with the car model, however it is delayed as it moves. Thanks Nick On Thu, Dec 19, 2013 at 12:02 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: 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 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 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_castosgUtil::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_castosgUtil::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 listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::MatrixTransform delays
Am 19.12.2013 12:09, schrieb Trajce Nikolov NICK: Sebastian, it was too early to be happy. Changing it to traverse first then update didn't helped actually. On the windshield model I have attached ParticleSystem that is actually delayed with the windshield. Any other ideas? I also tried to attach this directly to parts of the model but same results. It is about rain effect. This particle system is firing rain drops on the windshield geometry and it suppose to move with the car model, however it is delayed as it moves. Sorry, I'm out of ideas here too. If I got you correctly you have some group which represents a body and another one representing the windshield with the particlesystem attached. And you are updating the later with the update-callback. I don't understand why the two groups must be disjoint. Can you explain the reason for this? Are those two different render passes? If you explain your structure a bit more in depth I maybe can point to an alternative solution. cheers Sebastian Thanks Nick On Thu, Dec 19, 2013 at 12:02 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de mailto:sebastian.messerschm...@gmx.de wrote: 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_castosgUtil::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_castosgUtil::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 --
Re: [osg-users] osg::MatrixTransform delays
Hi Sebastian, You are right, that is the structure and the first thing I tried was to attach it directly to the body but then I saw this artifact like the particles following the model with delay. So I tried the update callback. Now I am thinking to have the particles attached to the main camera so they move with the view but here is again update callbacks and such. Thanks anyway ! Nick On Thu, Dec 19, 2013 at 9:35 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Am 19.12.2013 12:09, schrieb Trajce Nikolov NICK: Sebastian, it was too early to be happy. Changing it to traverse first then update didn't helped actually. On the windshield model I have attached ParticleSystem that is actually delayed with the windshield. Any other ideas? I also tried to attach this directly to parts of the model but same results. It is about rain effect. This particle system is firing rain drops on the windshield geometry and it suppose to move with the car model, however it is delayed as it moves. Sorry, I'm out of ideas here too. If I got you correctly you have some group which represents a body and another one representing the windshield with the particlesystem attached. And you are updating the later with the update-callback. I don't understand why the two groups must be disjoint. Can you explain the reason for this? Are those two different render passes? If you explain your structure a bit more in depth I maybe can point to an alternative solution. cheers Sebastian Thanks Nick On Thu, Dec 19, 2013 at 12:02 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: 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 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 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_castosgUtil::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_castosgUtil::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 listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing