XNA Essentials

Game Programming for Xbox 360, PC + Windows Phone

NAVIGATION - SEARCH

Matrices - Knowing the correct Multiplicatio Order......

Hi Chad,



Im only on Chapter 4,( the end of), so you might explain this better later on in the book, but on page 57, Transformation Reloaded you state that matrices are not communatative, which is fine, and that you you need to be careful of which order we perform those operations in.


 


Now i have reached the end of the Chapter, and iwhat i have gathered is the order should be:



1) Scale


2) Rotate


3) Translate (Move)



is that right? Do we always do it in that order then i presume?



Thanks again Chad.

garfbradaz - Friday, August 20, 2010 @ 8:16 AM

Re: Matrices - Knowing the correct Multiplicatio Order......

An easy way to remember is ISROT


Identity (or Initialize) - Optional


Scale


Rotation


Orbit (Translate then Rotate)


Translate


So you would typically do it in the order you specified, but if you wanted an object to orbit around another object, then you would Rotate AFTER you translated the object.  For example, you draw the sun in the origin.  You then draw the earth and translate it to the correct position 93M miles away and then you rotate it which will make it orbit around the sun.  Of course you could rotate it before you translate it to make it spin on it's axis.


Hope this helps!


Chad

Chad Carter - Monday, August 23, 2010 @ 7:34 AM

Re: Matrices - Knowing the correct Multiplicatio Order......

Again Chad, thank you, this helps greatly. Im in the middle of studing the following to help me grasp the Matrix Multiplication:


 


http://en.wikipedia.org/wiki/Matrix_multiplication


 


This is brow dripping stuff, but i feel is necessary to know before delving deeper into your book.

garfbradaz - Monday, August 23, 2010 @ 9:57 AM