Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-28 Thread Vincent Bourdier
Its ok, I've made some test and I understand how it works now... thanks for the help. I've another question, a similar one but I think I can ask it here : If my node is a PAT i do quat = pat-getAttitude(); if my node is a MatrixTransform i do quat = mt-getMatrix().getRotate(); But in the

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Robert Osfield
HI Vincent, The getWorldMatrices() method returns accumulated world matrices, if there is more than one then it means you have multiple parental paths and that multiple world matrices are required to position the different instances. The getWorldMatrices() is not a list of matrices along a

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Vincent Bourdier
Hi all, I make a little up of this topic because I'm now looking on it a last time (I hope) To be more clear, I have a difference between getting the transform quat with theses two way : osg::MatrixList ml = _node-getWorldMatrices(); osg::Matrixd Msum = osg::Matrixd::identity();

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Vincent Bourdier
Hi Robert, If I understand well, getWorldMatrices() return one matrix per parental path. but if I want to get the world Matrix, the one which represent the node's position and translation in absolute system, how can I do ? Which matrix I have to get ? I feel a little bit lost in theses

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Vincent Bourdier
Hi Alberto Thanks for help, I understand the instance problem... If all is good in my situation I would not have many instances of the same node... so I think it will be more simple... Because my problem is more recent, I ask a second question : To get this node's position (absolute ), if I

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Vincent Bourdier
In your example you are using getWorldMatrices. I know this function, thanks... I and Robert were talking about it. But what I simply need is : with a node, I need its position (absolute/world coordinates), and its orientation (in the world system coordinates). How can I do it ? (Sorry, I'm not

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Alberto Luaces
Sorry, I don't get what you exactly are looking for. Would this example help? It calculates the position of a node in world coordinates: #include osg/Node #include osg/Group #include osg/Matrix #include osg/MatrixTransform #include iostream int main() { osg::Group *root;

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-27 Thread Alberto Luaces
Sorry if I don't understand you again, but my program is giving you the absolute position of the node (the fourth column of the matrix, (10,20,-5)) and its world orientation ( the first 3x3 block, equal to identity since the two transforms were translation ones). Try changing m1 and m2 to see

[osg-users] Get Parent as Transform in Absolute ?

2008-03-21 Thread Vincent Bourdier
Hi all, I'm trying to get a node's parent as Transform (PAT or MatrixTransform) but I have to get the transformation in ABSOLUTE_RF... For the moment, I've done a recursive method to get Parent as Transform. It return me the first parent as Tranform it encounter. I've tried this :

Re: [osg-users] Get Parent as Transform in Absolute ?

2008-03-21 Thread Robert Osfield
Hi Vincent, I'm a bit confused about what you are trying to do, is it just get the accumulated world matrix at a specific node? If so then node::getWorldMatrices() is what you want. This will return a MatrixList, which will contain none, one or many matrices given that any node many have none