CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-20-2013, 07:04 AM   #1
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Matrix

Can someone please explain the following ... pleaseeeeeeeee

Matrix
Inverse Matrix
Parent Matrix
Parent Inverse Matrix
World Matrix
World Inverse Matrix
XForm Matrix

What values these Matrix store?

Thanks.
 
Old 07-20-2013, 02:12 PM   #2
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,415
What is your math skill level? Did you have a specific interest in those attributes?

This might be of interest: http://www.macaronikazoo.com/?page_id=413

David
__________________
http://www.djx.com.au
 
Old 07-21-2013, 03:37 AM   #3
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Hi djx,

I want to know definitions in following format:

The Matrix node is used to ....................
 
Old 07-21-2013, 05:53 AM   #4
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,415
Hmm. Did you try the docs?
In the "nodes" section (under technical documentation) look up "transform" and you'll get some nice info about the transform matrix, but since it inherits from the "dagNode", you'll need to look that one up as well. And of course you should also look up the "joint", since they have a couple of extras also worth knowing about.

David
__________________
http://www.djx.com.au
 
Old 07-21-2013, 10:19 AM   #5
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
If you want to know what a matrix does you should seriously consider reading about matrices in first place. Xform is for transform, the rest is all normal matrix related terminology, and it's not Maya specific, nor it can be explained sufficiently in a single post.

In short: A Matrix is how a transform is described.

You can start from here:
http://en.wikipedia.org/wiki/Matrix_(mathematics)
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 07-22-2013, 03:37 AM   #6
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Thanks ThE_JacO and David.

Actually I was trying to calculate angle between two joints and I was quite confused which matrix to to connect to the Decompose Matrix and angleBetween nodes.

Thanks.
 
Old 07-22-2013, 03:59 AM   #7
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
If that's still a problem:
Angle between in Maya takes vectors, think of them as arrows.

If you want the angle between first and second in a 3joint chain (say the elbow angle), you can take the vector between first and second, and the vector between second and third, and feed those two into angle between.

Attached how you could do it nodes-only on a 3j chain with output to a locator's rotation (just to show the effect).

If you work in world space when doing those subtractions you always get the "natural roll axis" between the joints, and spare yourself a hierarchy sensitive setup.

The +/-/Avg nodes are set to sub.
Attached Images
File Type: jpg Screenshot-Node Editor.jpg (76.6 KB, 60 views)
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes

Last edited by ThE_JacO : 07-22-2013 at 04:03 AM.
 
Old 07-22-2013, 04:32 AM   #8
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Thanks The JacO, this is what I was looking for.

Thanks again.
 
Old 07-22-2013, 05:16 AM   #9
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
You're welcome, I would still, however, strongly encourage you to look into the basics of linear algebra (vectors and matrix maths).
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 07-26-2013, 06:39 AM   #10
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Vector Product Utility Node

The JackO please help. According to Maya documentation:

Given an input vector (a, b, c) and an input matrix:

A B C D
E F G H
I J K L
M N O P

Then Vector Matrix Product is defined as follows:

x = (a*A) + (b*B) + (c*C)
y = (a*E) + (b*F) + (c*G)
z = (a*I) + (b*J) + (c*K)

I have connected Sampler Info > Normal Camera to vectorProduct1 > Input1 and Cube > xForm Matrix to vectorProduct1 > Matrix. The operation is set to Vector matrix Product.

Below are the values that Maya generates:

getAttr samplerInfo1.normalCamera;
// 0 0 1 //

getAttr pCube1.xformMatrix;
// 0.828906 0.336418 0.44692 0 -0.236082 0.934695 -0.265726 0 -0.507129 0.114752 0.854197 0 1.864228 1.752258 4.159013 1 //

I think it will be like this:

0.828906 0.336418 0.446920 0
-0.236082 0.934695 -0.265726 0
-0.507129 0.114752 0.854197 0
1.864228 1.752258 4.159013 1

According to documentation, the output should be 0.44692, -0.26573, 0.85420 but actual output is:

getAttr vectorProduct1.output;
// -0.507129 0.114752 0.854197 //

Am I doing something wrong?
 
Old 07-30-2013, 09:10 AM   #11
pixols
New Member
 
pixols's Avatar
portfolio
The CGKid
USA
 
Join Date: Jul 2013
Posts: 9
Can someone help please
 
Old 07-30-2013, 10:51 AM   #12
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
Multiplying a world axis unit vector such as 0,0,1 (world Z) by an object's matrix will result in the same exact (Z in this case) axis of that object after its transform.

Given that, your result, and the magnitues of the numbers it becomes pretty obvious that Maya's output when printing the matrix is:
[0.828906 0.336418 0.44692 0] X axis of the object's xform
[-0.236082 0.934695 -0.265726 0] Y axis of the object's xform
[-0.507129 0.114752 0.854197 0] Z axis of the object's xform

[1.864228 1.752258 4.159013 1] translation of the object.

Which looks like an object translated to 1.864228 1.752258 4.159013 with a slight orientation offset but still fairly well aligned to world (each axis' dominant scalar is the same as the axis "label" itself, so X component dominant for the X axis, Y for the Y axis and Z for the Z axis).

Your only mistake was assuming that the text representation of an object that isn't text in itself must have been unequivocally just the scalars serialized the way you thought they would have been, but the pattern to figure out what is being printed is actually quite obvious.

Again I would suggest you look into matrices and vectors and try to get a little bit more of an intuitive understanding of the subject before making assumptions about their arithmetic decomposition, printing and so on
No offense implied, purely a suggestion to get through your learning in an optimal fashion. If you decide not to, at least try to think more openly and always do multiple tests to figure out how things work when you're trying to reverse engineer your way back through a problem or a new subject. Just the one is not a great way to draw conclusions and get stuck.
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 07-31-2013, 07:17 AM   #13
zoharl
A newbie
 
zoharl's Avatar
portfolio
Zohar
Wellington, New Zealand
 
Join Date: Mar 2009
Posts: 1,820
Guys, I lost you here:

Quote:
Originally Posted by pixols
Given an input vector (a, b, c) and an input matrix:

A B C D
E F G H
I J K L
M N O P

Then Vector Matrix Product is defined as follows:

x = (a*A) + (b*B) + (c*C)
y = (a*E) + (b*F) + (c*G)
z = (a*I) + (b*J) + (c*K)


The dimensions of the vector and matrix are incompatible, and the formula is wrong. You need to convert the vector to homogenous coordinates (google), then multiply, then convert back.
Also, please provide a full code that reproduces your scene/problem, since I'm not familiar with these nodes or problem (unless you got your answer already).
 
Old 07-31-2013, 11:33 AM   #14
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
Nah, given convention the dimensions are perfectly compatible

More apps than not (and this includes Maya, Soft, and Nuke for sure) given a 3D vector and a 4x4 matrix assume the classic pre-homogenized vector and matrix, you practically suppress a a lot if you can assume matrix normality, and turn it into a 4x3 * 3x1 (or 4x1 with w at 0 or 1 if it makes you more comfortable).

The actual operation you can actually even consider 3x3 * 3x1 with the last row (displacement) added later if the vector is a displacement (w= 1), or suppressed if it's a normal (w= 0).

Notice how the last column is 0,0,0,1 (or last row if you think in terms of row matrices).

Lastly: if you prefer this thinking you can think of the 3D vector as a quadrivector with W assumed by context (see above).
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes

Last edited by ThE_JacO : 07-31-2013 at 11:43 AM.
 
Old 07-31-2013, 11:33 AM   #15
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:16 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.