It is currently 26 May 2013, 04:05

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Why SRT In Matrix ?
PostPosted: 09 Apr 2013, 03:15 
Offline
User avatar

Joined: 13 Sep 2012, 02:15
Posts: 509
How come matricies are read S,R,T with translation being last, what is the reason for this in 3D software ?

_________________
I only do Face-Spucken, not FaceBook-ing :).


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 09 Apr 2013, 10:30 
Offline

Joined: 09 Jun 2009, 20:33
Posts: 148
nope transformations aren't applied in this order i think take a look at wikipedia...

If you can translate french maybe you can read this article who explain you the transforms in ICE and in particular convertion between local and global
http://fbonometti.blogs.3dvf.com/archives/799


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 09 Apr 2013, 14:51 
Offline
User avatar

Joined: 17 Nov 2009, 18:46
Posts: 295
I made a tutorial awhile back to try to explain 4x4 matrix - http://www.si-community.com/community/viewtopic.php?f=41&t=1707

My first attempt to understanding matrix was from trying to translate XNA game code into ICE. It's a bit of a mess; maybe there's something in there helpful - http://www.si-community.com/community/viewtopic.php?f=15&t=1060&hilit=game+xna

The top (left) 3x3 matrix is used to calculate scale and rotation. The numbers correspond to the direction that the axis points at. So pointing out in X (normalized) is 1,0,0. Y = 0,1,0, Z = 0,0,1.

Identity matrix
1,0,0
0,1,0
0,0,1

Scaling in X by 2x would be 2,0,0. Scaling half of Y would be 0,.5,0. When you rotate the matrix, the numbers will change, utilizing sin and cos to calculate the new vector.

Because of the way they are calculated, it allows you to apply other mathematic operations to the matrices (multiplying them together, etc). Hopefully that helps explain.


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 09 Apr 2013, 15:32 
Offline
User avatar

Joined: 19 Mar 2010, 00:38
Posts: 444
Location: St. Thomas, Ontario
Softimage is row-major vector based, so the SRT is the correct order of operation in Soft (and an easy way to remember it).

Be careful with Wikipedia and other math primer, you have to understand the difference between row-major vector and column-major vector operation on matrices. As an example, OpenGL is column-major vector based and therefore the matrices and order of operation will be different. To translate column-major matrices into row-major matrices, you will need to "transpose" the matrix.

Code:
OpenGL

| mo m4  m8  m12 |
| m1 m5  m9  m13 |
| m2 m6 m10  m14 |
| m3 m7 m11  m15 |       

Code:
Soft
|  m0   m1   m2  m3 |
|  m4   m5   m6  m7 |
|  m8   m9  m10 m11 |
| m12  m13  m14 m15 |


You also have to factor in the coordinate system you are working with (left hand or right hand coordinate). This will have an impact on the matrix order and representation. Softimage is a right hand coordinate system with Y axis up.

I have attached the matrix representation in Softimage for your info. Please note that I am using affine transformation matrices (4x4 matrix). This is easier to work with when translation is included.


Attachments:
Softimage matrix.jpg
Softimage matrix.jpg [ 62 KiB | Viewed 238 times ]

_________________
$ifndef "Softimage"
set "Softimage" "true"
$endif
Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 11 Apr 2013, 00:25 
Offline
User avatar

Joined: 13 Sep 2012, 02:15
Posts: 509
Daniel Brassard wrote:
Softimage is row-major vector based, so the SRT is the correct order of operation in Soft (and an easy way to remember it).

Be careful with Wikipedia and other math primer, you have to understand the difference between row-major vector and column-major vector operation on matrices. As an example, OpenGL is column-major vector based and therefore the matrices and order of operation will be different. To translate column-major matrices into row-major matrices, you will need to "transpose" the matrix.

Code:
OpenGL

| mo m4  m8  m12 |
| m1 m5  m9  m13 |
| m2 m6 m10  m14 |
| m3 m7 m11  m15 |       

Code:
Soft
|  m0   m1   m2  m3 |
|  m4   m5   m6  m7 |
|  m8   m9  m10 m11 |
| m12  m13  m14 m15 |


You also have to factor in the coordinate system you are working with (left hand or right hand coordinate). This will have an impact on the matrix order and representation. Softimage is a right hand coordinate system with Y axis up.

I have attached the matrix representation in Softimage for your info. Please note that I am using affine transformation matrices (4x4 matrix). This is easier to work with when translation is included.


I understand the Translation, and scaling of a matrix, not so much the rotation from the graph image.

_________________
I only do Face-Spucken, not FaceBook-ing :).


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 11 Apr 2013, 02:11 
Offline
User avatar

Joined: 17 Nov 2009, 18:46
Posts: 295
Falam, please try to understand this inside of ICE by show numeric values. It's very hard to comprehend just by looking at a grid of numbers on a website... Store a SRT to Matrix -> 4x4 matrix (force it to a 4x4 matrix) -> set data. I would show values on each section, 1 showing Axis, 1 showing numeric. Then rotate the numbers around each axis 90 degrees. Notice how the numbers in the matrix change. REMEMBER: they correspond to the vector that the axis is pointing at.
1,0,0
0,1,0
0,0,1

As you rotate them at 90 degree intervals (and assuming Scale =1), you will see those numbers changing between -1 and 1. So maybe:
1 > 0 > -1 > 0 > 1 or maybe
0 > -1 > 0 > 1 > 0 or
0 > 1 > 0 > -1 > 0. That's the Cosine and Sin at work for ya.......

It is SOOOOOOO much easier to grasp this stuff when you can visualize changes thru ICE!!!!
Please try first in ICE, and then report back.


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 11 Apr 2013, 03:03 
Offline
User avatar

Joined: 13 Sep 2012, 02:15
Posts: 509
I did try in ICE before asking the question, I wanted to know how Softimage solves a matrix, that I have an understanding for. Surprising that rotations are just SIN and COSINE curves.

_________________
I only do Face-Spucken, not FaceBook-ing :).


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 11 Apr 2013, 04:55 
Offline
User avatar

Joined: 17 Nov 2009, 18:46
Posts: 295
Makes sense when think about it. How do you calculate points moving around a circle... Cos and sin. ;)


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 11 Apr 2013, 05:28 
Offline
User avatar

Joined: 19 Mar 2010, 00:38
Posts: 444
Location: St. Thomas, Ontario
http://mathworld.wolfram.com/RotationMatrix.html'

Watch also these videos on KhanAcademy

https://www.khanacademy.org/math/linear-algebra/matrix_transformations/lin_trans_examples/v/rotation-in-r3-around-the-x-axis

_________________
$ifndef "Softimage"
set "Softimage" "true"
$endif


Top
 Profile  
 
 Post subject: Re: Why SRT In Matrix ?
PostPosted: 13 Apr 2013, 02:36 
Offline
User avatar

Joined: 13 Sep 2012, 02:15
Posts: 509
I have to do some of my own studying on this, I see what is going on when I visual in ICE, still not understanding, for the thread here is what I did.

Image

Image

_________________
I only do Face-Spucken, not FaceBook-ing :).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group