Hi Chris, A quick look at your model (after converting it to .osg) shows that the MatrixTransforms are there alright but there are no drawables connected to them. Instead the 2 existing Geodes (each with 1 Geometry) are located in a separate node tree parallel to the MatrixTransforms that you are trying to use. I suggest you do this: export OSG_NOTIFY_LEVEL=INFO export OSG_OPTIMIZER=OFF osgconv lefthand.3ds lefthand.osg ... osgconv will print lots of useful information and then you can inspect lefthand.osg in your favourite text editor.
/Mattias On Wed, Sep 17, 2014 at 4:15 PM, Chris Hidden <ch...@erghis.com> wrote: > Thanks agin for helping me with this. > > While I am very new to all of this, I have spent the better part of the last > 5 weeks learning open scene graph. I have a basic knowledge of a fair chunck > of it I believe. My problem is, is that I have gone through many of the > examples, I have worked through the majority of the OpenSceneGraph for > Beginners book and scoured the forums many a time. > > The osgrobot example is a good example, except it shows you how to assemble > your own shapes and add them to global MatrixTransforms. I suppose I could > build a simple hand model of capsules and shapes as well and get them to > function similarily. > > But why put the time into rebuilding a lower quality hand model when I > already have one. My problem is just that with the .3ds hand model I haven't > built it myself and don't know the exact structure. Also I am doing this for > my company and I unfortunately have a time pressure over my head. > > In the osgRobot example, its very clear that we have a group of > MatrixTransforms that have drawables as children to the MatrixTransforms. So > when a rotation is applied to the transform it is also applied to its > children hence moving a part of the model. > > The hand model is not made up of clear indivudal parts however. If it is, I > don't know how to access them. I can traverse through the hands parts and > see how its built and what parts have what names. This doesn't help me > understand how to manipulate its geometry though. > > For example the hand is made up of 5 fingers. Each finger has 4 joints and > an end aside from the thumb which has 3 joints and an end. These joints and > ends show up as MatrixTransforms when I call className() on them from a given > Node in a traversal class. > > Ex: > > > Code: > > class TestTraverser : public osg::NodeVisitor > { > public: > TestTraverser() : NodeVisitor(TRAVERSE_ALL_CHILDREN), spaces(0){} > > virtual void apply(osg::Node &node) > { > > OSG_NOTICE << std::string(spaces * 2, ' ') << "Traverse > Class. This node is a: " << node.libraryName() << "::" << node.className() > << " and has the associated name: " << node.getName() << std::endl; > > spaces++; > traverse(node); > spaces--; > } > > protected: > int spaces; > }; > > > > > For the Index finger I would get this output: > > Traverse Class. This node is a: osg::MatrixTransform and has the associated > name: L_IndexA > Traverse Class. This node is a: osg::MatrixTransform and has the > associated name: L_IndexB > Traverse Class. This node is a: osg::MatrixTransform and has the > associated name: L_IndexC > Traverse Class. This node is a: osg::MatrixTransform and has > the associated name: L_IndexD > Traverse Class. This node is a: osg::MatrixTransform and has > the associated name: L_IndexEND > Traverse Class. This node is a: osg::Geode and has the > associated name: > Traverse Class. This node is a: osg::Geode and has the > associated name: > Traverse Class. This node is a: osg::Geode and has the > associated name: > Traverse Class. This node is a: osg::Geode and has the > associated name: > Traverse Class. This node is a: osg::Geode and has the associated > name: > > Notice how the Goeds don't have names. I am assuming this because they don't > need names when someone is modelling in a modeling program they worry only > about labeling the joints. The Geodes are actually just representations of > the geometry that makes up a fingers appearence, correct? > > So I can then grab say for example a single node and create a reference to > it, something like: > > > osg::ref_ptr<osg::MatrixTransform> indexB = new osg::MatrixTransform; > if(node.getName() == "L_IndexB") > indexB = node; > > Then in later on assuming indexB is global I can do > indexB->setMatrix(osg::Matrix::translate(1,0,0)); > in an Update() method that runs every frame. > > > This should move the matrixTransform, and I would expect the finger to look > weird on the screen when running the application. Assuming B is the middle > knuckle of the finger, the left index finger knuckle should be bowed out to > the left. But it never is. > > So to make sure I was actually moving something I added an axes to all the > MatrixTransforms. Like in the osgrobot example where it shows axes arrows on > each shape. So then I could see all the matrixTransforms on my hand model > because the axes are on there. AND! I could now see that the axis that would > normally be where the left index finger joint is now over to the left. So > the matrix is actually moved but the hand itself is visually unchanged. > > I can even do something like > indexB->setMatrix(osg::Matrix::rotate(50, osg::Z_AXIS) * > indexB->getMatrix()); > > And then the axes will spin around and around, but the finger never does. > What I don't understnad is why. Thats whay I was hoping to get at. > > Also, because Im new my terminology is useless, I understand a lot of the > concepts even though I can't expess them in the same way one who has more > experience does. Also one who has experience as yourself might think what > you are saying to me is crytal clear but because I may not be used to hearing > certain terms or have maybe a key concept mixed up in my brain I > misunderstand. > > Really I am just trying to prove right now that I think I have enough > understanding to figure this out. I feel like Im so close, I can make any of > my own drawables and shapes move this way, but not the hand model. > > To help clarify even more I've attached a simple example of what I am trying > to achieve in order to learn how to do this. Maybe that will make things > clearer. Here is the link to the hand model i am using from my dropbox: > > https://dl.dropboxusercontent.com/u/44220561/lefthand.3ds > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=61065#61065 > > > > > _______________________________________________ > 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