Re: [osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it
Solved. Yes, truly the transformation matix was not attached to the scene graph, that caused problem, described above. Also, i used osg::AnimationPath and no NodeCallback is required here. Thank you! Cheers, Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64706#64706 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it
Hi, scrawl! Im not sure that i understand what do you mean by saying detached graph. I have now: Root-Group-MatrixTransform-Node. //Here is Node ref_ptrNode nodeEngineCW = osgDB::readNodeFile(pathToACModels + engineCW.ac); //Here is MatrixTransform ref_ptrMatrixTransform setupForwardEngine = new MatrixTransform; setupForwardEngine-addChild( nodeEngineCW.get() ); //Here is Group ref_ptrGroup groupAircraft =new Group; groupAircraft-addChild( setupForwardEngine.get() ); //Here is Root ref_ptrGroup rootnode = new Group; rootnode-addChild( groupAircraft.get() ); Everything seems fine in this sense. Thank you! Cheers, Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64586#64586 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it
Am 01.08.2015 um 08:59 schrieb Elias Tarasov: Hi! I have .ac models. One is a quadrocopter and two others are it's engines. Each engine has propeller, which i want to animate by rotation. To do it, i have to find propeler's node for the start. What i was able to find that two ways are exist. First is to find a node by it's name. Second is to find a node by it's unique characteristics. Here is models: https://drive.google.com/file/d/0ByDDImhSolf6cnVIN3JIMzJQTGs/view?usp=sharing So the 1st question: How to determine, the name of the node or it's other characteristics, to be able to find it? Using NodeVisitors is the way to go with scenegraphs. I developed simple program that searches a node by it's name. Something, that looks like a node's name i found when open .ac file using notepad and search for the name tag. But im not sure. Here is code: https://drive.google.com/file/d/0ByDDImhSolf6U3BmTXpjeE1mRDg/view?usp=sharing The problem: NodeVisitor finds a node( though im not sure this node is a propeller), but NodeCallback doesn't rotate it. So the 2nd question: Why the element, identified by it's name, does not rotate? The reason, why im sure that these models should be able to rotate anyway, is that i took them from another app, based on OSG and it works well. Your sample code isn't what I would consider minimal, so it is hard to spot an obvious error. But I don't see how the MatrixTransform is related to your scene graph. You need to do something like this inside your callback for (p : node-getParents()) { p-removeChild(node); p-addChild(matrixTrans); } matrixTrans-addChild(node) Your code simply adds a new parent, so the propeller is most likely drawn twice the time you would expect. Btw. If your visitor is looking for the node-name only you don't have to implement anything else but the apply(Node) as even the osg::Geode/osg::Drawables and are osg::Node-derived since version 3.3.0. Cheers Sebastian Thank you! Cheers, Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64557#64557 ___ 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] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it
The MatrixTransform you are creating isn't actually in the scene graph. What you have now is: Root - (some parent) - Node as well as a completely detached graph that won't have an effect. MatrixTransform - Node What you need instead is: Root - (some parent) - MatrixTransform - Node -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64563#64563 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it
Hi! I have .ac models. One is a quadrocopter and two others are it's engines. Each engine has propeller, which i want to animate by rotation. To do it, i have to find propeler's node for the start. What i was able to find that two ways are exist. First is to find a node by it's name. Second is to find a node by it's unique characteristics. Here is models: https://drive.google.com/file/d/0ByDDImhSolf6cnVIN3JIMzJQTGs/view?usp=sharing So the 1st question: How to determine, the name of the node or it's other characteristics, to be able to find it? I developed simple program that searches a node by it's name. Something, that looks like a node's name i found when open .ac file using notepad and search for the name tag. But im not sure. Here is code: https://drive.google.com/file/d/0ByDDImhSolf6U3BmTXpjeE1mRDg/view?usp=sharing The problem: NodeVisitor finds a node( though im not sure this node is a propeller), but NodeCallback doesn't rotate it. So the 2nd question: Why the element, identified by it's name, does not rotate? The reason, why im sure that these models should be able to rotate anyway, is that i took them from another app, based on OSG and it works well. Thank you! Cheers, Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64557#64557 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org