Copy the MatrixDemo sprite into your 3D projects. Add the other required sprite code, costumes, and sounds. You may delete the custom blocks beginning with "Util:" if you don't need them. To perform a matrix operation: Write the entire expression in Reverse Polish Notation (RPN) so you can express it using the given custom blocks. For example the product of A with the product of B and C Regular Notation: A x (B x C) RPN: A (B C x) x which is equivalent to A B C x x (parentheses are redundant in RPN :) ) Then you code it as follows: Matrix () () () () ()... (Enter values for Matrix A) Matrix () () () () ()... (Enter values for Matrix B) Matrix () () () () ()... (Enter values for Matrix C) Multiply Multiply See the note in the sprite to understand how the elements of a 4x4 matrix are named. It is recommended that you use the provided rotation and transformation matrix generators instead of writing the matrices yourselves. The following example creates the matrix of an object rotated 45deg around its X axis, then translated 10 units along its X axis. X Rotation Matrix (45) Translation Matrix (10) (0) (0) Multiply These are only the instructions to use this matrix implementation. To practically use it, you will need further self study on how to use matrices in 3D graphics.
This is partly what I had learned about matrices in my 10th grade. I also got a lot of help from Wikipedia and MathIsFun. All code were written by me.