Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

matrix transposition and translation vector


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 giugio   Members   -  Reputation: 182

Like
0Likes
Like

Posted 09 July 2012 - 08:10 AM

Hy.
I have a scenegraph.
Each object in the scenegraph is a node and can have a parent(1 or 0 ) for my application i must multiply from the bottom to the top.
Each node have a 3x3 rotation matrix and a 3dvector for the traslation.
I can do node->parent for find the parent node.
i use a loop for iterate from bottom to top and use the parent() function.

1)i do in the loop: currentMatrix =currentNode->parent()->getmatrix3x3->Trasposed() * currentMatrix
then the currentNode becomes : currentNode = currentNode->parent() until the parent == 0.
2)first problem : how i must multiply the translation vectors where each node is? At each position i must draw a mesh , then i must have the correct location.

3)I must use transposed matrix for my project , is correct do the transposition every cicle only for the new matrix?like
currentNode->parent()->getmatrix3x3->Trasposed() * old concatenate matrix?

thanks.

Edited by giugio, 09 July 2012 - 08:11 AM.


Sponsor:

#2 Faelenor   Members   -  Reputation: 370

Like
0Likes
Like

Posted 09 July 2012 - 11:22 AM

Why don't you use 4x4 matrices? You would have your translation in the matrix and computed with the multiplication.

If you have to multiply by the transpose, create a multTranspose kind of method instead of using a temporary transposed matrix object. You don't need this object, you just have to multiply the matrix components in the transposed direction.

Finally, when you traverse you tree, you can keep a pre-multiplied matrix of all the node from the parent to the root, to avoid your costly loop.

Edited by Faelenor, 09 July 2012 - 11:23 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS