[osg-users] animated moving of a MatrixTransform
Hi, i want to move a MatrixTransform (mt) with animation. I dont want to generate an new pat or something like this under the mt. When i directly animate the mt with Code: osg::Vec3d startAnimationVec = mt-getBound().center(); osg::Vec3d endAnimationVec = startAnimationVec + osg::Vec3f(0.0f,2.0f,5.0f); osg::ref_ptrosg::AnimationPath animationPath = new osg::AnimationPath(); animationPath-setLoopMode(osg::AnimationPath::NO_LOOPING); animationPath-insert(0, startAnimationVec); animationPath-insert(1, endAnimationVec); osg::ref_ptrosg::AnimationPathCallback animationPathCB = new osg::AnimationPathCallback(animationPath.get(), 0.0, 2.0); animationPathCB-setAnimationPath(animationPath.get()); mt-setUpdateCallback(animationPathCB.get()); the movement is correct but the the other values in the mt are erased. So before the animation the Matrixd of the mt look like Code: (a,b,c,x, d,e,f,y, g,h,i,z) and afterwards Code: (1,0,0,x, 0,1,0,y, 0,0,1,z) How can i animate without losing the matrix? Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35507#35507 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disappearing Text
Hi, with Code: osg::ref_ptrosgText::Text label = new osgText::Text(); osg::ref_ptrosg::Geode labelGeode = new osg::Geode(); labelGeode-setName(TEXT_TOP); labelGeode-addDrawable(label.get()); label-setCharacterSize(1.3); label-setFont(arial.ttf); label-setText(fileName); label-setAxisAlignment(osgText::Text::XY_PLANE); label-setDrawMode(osgText::Text::TEXT); label-setAlignment(osgText::Text::CENTER_TOP); label-setPosition( osg::Vec3(0.0f, 0.5f,6.05f) ); label-setColor(_textColorTop); shapeGroup-addChild(labelGeode.get()); i write text on a geode. But when the geode is ovelayed with a transparent geode the text disappears. Code: osg::ref_ptrosg::Material shapeMaterial = new osg::Material; //rote Einfärbung shapeMaterial-setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f)); shapeMaterial-setTransparency(osg::Material::FRONT_AND_BACK, 0.8f); osg::ref_ptrosg::StateSet stateSet = new osg::StateSet(); stateSet-setMode(GL_BLEND, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON ); stateSet-setAttribute(shapeMaterial.get(), osg::StateAttribute::OVERRIDE); stateSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); shapeGeodeRZ-setStateSet(stateSet.get()); How can i stop the text from disappearing? Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35545#35545 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org