Hello Ted,
Gladly you included the code you use, which allowed me to know exactly
why you don't see anything. Look at this line:
matrixtransfm->setChild(0, geode);
Why did you use setChild(0, geode) instead of addChild(geode)? It is a
mistake. Look at the first few lines of osg::Group::setChild()
(MatrixTransform is an indirect subclass of Group):
bool Group::setChild( unsigned int i, Node* newNode )
{
if (i<_children.size() && newNode)
{
// ...
}
else return false;
}
So since your MatrixTransform has no children initially, setChild(0,
geode) does nothing. There is no index 0 in its children vector, so it
can't set it to the node you passed...
Try addChild() instead. Incidentally, if you had checked the return
value of setChild() it would have been false, telling you it had failed
(I'm not criticising, just making a remark, I wouldn't have checked the
return value either ;-) ). Or, if you had stepped through your program
in a debugger, you would have seen that after the call to setChild(0,
geode), the children vector of the MatrixTransform was still empty.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org