[osg-users] moving model and osgParticle...

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC Shayne.Tueller at HILL.af.mil
Wed Jul 16 17:32:57 PDT 2008


I'm attempting to have some smoke track an airplane model as it moves. The
problem is that the smoke is not rendered as the plane moves along. Below is
the code snippet I'm using to set things up.

 

.

osgParticle::ParticleEffect* smoke = 0;

smoke = new osgParticle::SmokeTrailEffect(mm_position, scale, intensity);

smoke->setWind(wind);

 

osg::Group * effectsGroup = new osg::Group;

effectsGroup->addChild(smoke);

smoke->setUseLocalParticleSystem(false);

 

osg::MatrixTransform *mt = new osg::MatrixTransform();

mt->addChild(cessnaNode);

osg::NodeCallback * nc = new ModelPosOrientCallback(x,y,z,0,0,0);

mt->setUpdateCallback(nc);

mt->addChild(effectsGroup);

 

root->addChild(mt);

 

osg::Geode * geode = new osg::Geode;

geode->addDrawable(smoke->getParticleSystem());

 

root->addChild(geode);

 

viewer->setSceneData(root);

.

 

Can anyone tell me what I'm doing wrong and what I need to do to get things
working correctly?

 

If I comment out the call "smoke->setUseLocalParticleSystem(false)" code,
the smoke appears but does not track with the airplane model as it moves.

 

Thanks,

-Shayne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080716/aa8f23c3/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6028 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080716/aa8f23c3/attachment-0002.bin>


More information about the osg-users mailing list