simGetObjectMatrix

Typically: "How do I... ", "How can I... " questions
Post Reply
eason

simGetObjectMatrix

Post by eason » 23 Aug 2015, 14:51

Dear administrator,
simGetObjectMatrix : some elements in this matrix , such as the x-axis of the orientation component is (matrix[0],matrix[4],matrix[8]) in the definition. what does the orientation component concretely represent ? what does the
translation component mean?

Definition:
matrix: pointer to 12 simFloat values (the last row of the 4x4 matrix (0,0,0,1) is not needed)
The x-axis of the orientation component is (matrix[0],matrix[4],matrix[8])
The y-axis of the orientation component is (matrix[1],matrix[5],matrix[9])
The z-axis of the orientation component is (matrix[2],matrix[6],matrix[10])
The translation component is (matrix[3],matrix[7],matrix[11])
I am looking forward to giving me a reply at your convenience.
thanks

DannyYeong
Posts: 44
Joined: 24 Feb 2015, 17:06

Re: simGetObjectMatrix

Post by DannyYeong » 23 Aug 2015, 15:25

eason wrote:Dear administrator,
simGetObjectMatrix : some elements in this matrix , such as the x-axis of the orientation component is (matrix[0],matrix[4],matrix[8]) in the definition. what does the orientation component concretely represent ? what does the
translation component mean?

Definition:
matrix: pointer to 12 simFloat values (the last row of the 4x4 matrix (0,0,0,1) is not needed)
The x-axis of the orientation component is (matrix[0],matrix[4],matrix[8])
The y-axis of the orientation component is (matrix[1],matrix[5],matrix[9])
The z-axis of the orientation component is (matrix[2],matrix[6],matrix[10])
The translation component is (matrix[3],matrix[7],matrix[11])
I am looking forward to giving me a reply at your convenience.
thanks
Good day!

I've used this command in my project as a way to retrieve the object's transformation matrix. Do you know how a transformation matrix works? The 4x4 matrix represents the transformation of an object prior to its attached frame. This matrix will numerically tell you what's the object's orientation and translation position in the scene.

Those callings such as matrix[0] or [1] etc are a way to retrieve any desired values from the 4x4 matrix.

You could do some research on transformation matrix to understand how the matrix works, and that'll give you a better understanding on orientation and translation. A side note to take: If you are retrieving the values from an object, the return values are counted from 1-16, not 0-15 in the 4x4 matrix.


Regards,
Danny

ahundt
Posts: 112
Joined: 29 Jan 2015, 04:21

Re: simGetObjectMatrix

Post by ahundt » 24 Aug 2015, 03:31

Here is a good link that explains the concept:
https://studywolf.wordpress.com/?s=robot+control+part+1

There are 6 more parts to that tutorial that get more advanced as things go on.

Post Reply