Jump to content

get the trans and rot matrix of object


Recommended Posts

Hi, everyone.

There are two object, one of them with translate and rotate, and another was keep static.

Now i want get the trans and rot matrix of first object, then apply it to second one. I have to search transform matrix for long time, and learn copying and instancing point attributes, but still confused with the matrix.

So i post a simply file for help, if anyone give me some tips will be great!  :)

Is transform matrix can export as a point , such as packed represent point . And transform object by wrangle will be great too.

Thanks.

trans_and _rot_matrix.hip

Edited by wateryfield
Link to comment
Share on other sites

I wrote a small tool for attaching pieces to other geos. But it was done really long long ago. So dont ask me how it works and why it is done this  way.)) I guess I was just young and unexperienced. Anyway it may help and it works.

trans_and _rot_matrixArchiFollow.hip

Edited by Artem Smirnov
  • Like 2
Link to comment
Share on other sites

I wrote a small tool for attaching pieces to other geos. But it was done really long long ago. So dont ask me how it works and why it is done this  way.)) I guess I was just young and unexperienced. Anyway it may help and it works.

Thanks for your quick reply, Smirnov.  :)

Your tool working great, and the wrangle also my expect one.

I promise i will not ask anything about your cool tool. XD

 

But if anyone have a simply one will be great.

Edited by wateryfield
Link to comment
Share on other sites

is this helpful ?

Thanks, Doshi.

It really helpful.  :)

But i was confused with attribvop one.  Why N,up,bitangent and P can make up a matrix4, is it a simple matrix theory.

And why static matrix multiply with invert transform matrix?

Forgive me if the problem was horrible basic.

Link to comment
Share on other sites

I am not an expert on this. I had asked similar question few day back  http://forums.odforce.net/topic/22596-extracting-transformation-using-matrix/

 This is what I understood so far. Experts please correct me if I am wrong.

read this http://mathforum.org/library/drmath/view/69806.html

1. You need a 4x4 matrix. First three rows gives you orientation. (N, up and bitanget  refer file. You can give them any name for example name them as  New , upon, bit and it works just fine. Their connection sequence is not important. Make sure you make the same change for both the 4x4 matrices in the attribvop.)

2. These vectors form a reference plane for static geo and for the moving geo (these vectors get oriented as per the motion of the geo and so does the reference plane for the moving geo.)  

3.about inverse matrix. I think following explanation will help you understand why we need inverse matrix.

 

http://math.mit.edu/~gs/linearalgebra/ila0205.pdf

 

Inverse Matrices

Suppose A is a square matrix. We look for an “inverse matrix” A1 of the same size, such that A1 times A equals I . Whatever A does, A1 undoes. Their product is the identity matrix—which does nothing to a vector, so A1Ax D x. But A1 might not exist. What a matrix mostly does is to multiply a vector x. Multiplying Ax D b by A1 gives A1Ax D A1b. This is x D A1b. The product A1A is like multiplying by a number and then dividing by that number. A number has an inverse if it is not zero— matrices are more complicated and more interesting. The matrix A1 is called “A inverse.” DEFINITIO

 

Take a any geo, create vectors using polyframe node (N,up, bitanget). Connect attribvop to it. Create 4x4 matrix from N up bittanget and P. Invert it.Multiply P by this inverted matrix. You will notice all the points of the geometry go to center of the scene.

 

4. Last component of 4x4 matrix  gives translation (element 12 , 13 and 14 of a matrix, so P is connected in the end)

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...