[osg-users] Visualizing a light cone in scene
Ekaterina Fokina
ekaterina.fokina at tum.de
Fri Jan 13 08:06:40 PST 2017
Hi,
I am doing something similar. If you want to have your cone tilted attach it to your air vehicle using MatrixTransform, like in the example "osgspheresegment":
osg::MatrixTransform* positioned = new osg::MatrixTransform;
positioned->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
positioned->setDataVariance(osg::Object::STATIC);
positioned->setMatrix(osg::Matrix::translate(-bs.center())*
osg::Matrix::scale(size,size,size)*
osg::Matrix::rotate(osg::inDegrees(180.0f),0.0f,0.0f,1.0f));
positioned->addChild(cessna);
positioned->addChild(lod);
osg::MatrixTransform* xform = new osg::MatrixTransform;
xform->setUpdateCallback(new
osg::AnimationPathCallback(animationPath,0.0f,2.0));
xform->addChild(positioned);
model->addChild(xform);
Could you please tell, how did you make the trace on the ground?
Thank you!
Cheers,
Ekaterina
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69968#69968
More information about the osg-users
mailing list