   Basic World Matrix Questions
  Hi - I'm a beginner when it comes to programming, but I believe these questions should be pretty simple.  I pulled it from a university's lecture notes that I'm going through.  Scenario and questions below:-----Assume a spaceship was modeled in local space pointing down the –z axis.  It’s placed in the world using the following matrix:M = [ax bx cx dxay by cy dyaz bz cz dz0  0  0  1 ]What world space direction is the spaceship facing?What is the world space position of the spaceship?The pilot of the ship looks up and sees an enemy ship approaching.  What world space direction is he looking?---Thanks guys for your help
  Can't quite tell if this is a homework problem or not, but here's a hint: Assuming the matrix represents a typical affine transform, the first three columns of the matrix will represent the local basis vectors ('direction' vectors) for the object, while the last column will represent the translation (position).From there, you should be able to figure out the answers to the questions you listed. (Also, if it's not an actual homework question, perhaps you could clarify that, since in that case we can provide more specific answers.)   ;  It's not a homework assignment.  It was part of a slide of some old 2006 lecture notes that I was looking through.   ;  Yeah I was thinking (dx,dy,dx) will be where the spaceship will end up post-transformation.---Editing cause I read the response wrong.I'm still unsure as to the 1st and 3rd questions.   ;  The important parts are a, b, c, d. The first 3 are vectors, the last one is a position. (i.e. w=0 is a vector, w=1 is a point). Think about the identity matrix for a moment. 1 0 0 00 1 0 00 0 1 00 0 0 1Grab a piece of paper, draw the point d, and draw the 3 vectors a, b, c leaving it. I might recommend you draw the vectors using a few coloured pens (red, green and blue make excellent choices!). You'll very quickly figure out the answers to all the above questions... :)Quote:Original post by mizuno hadoukenThe pilot of the ship looks up and sees an enemy ship approaching.  What world space direction is he looking?.... Apart from this one. The answer involves a circle, but I'll leave you to figure out why. /editI'd also point out that typically C++ programmers tend to look at that matrix transposed. (i.e. a runs across the top, d along the bottom, and 0,0,0,1 on the right).   ;Quote:I'd also point out that typically C++ programmers tend to look at that matrix transposed. (i.e. a runs across the top, d along the bottom, and 0,0,0,1 on the right).Hm, that's not true. Are you talking about the difference between row-basis and column-basis matrices? That is, matrices intended for use with row vectors as opposed to those intended for use with column vectors?If so, there's no correlation between programming in C++ and using one or the other. Some C++ math libraries and APIs use row vectors, some use column vectors, and some support both. But, there's nothing about C++ that has any implications with respect to which convention is used.   