Public Group

# Matrices are my new best friends!

This topic is 5099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I had been avoiding matrices up until now because they looked strange and scary. However after browsing 100+ posts and articles on this site and opengl.org I decided that if I was going to make a camera class I'd probably have to learn matrices to follow any of those tutorials. In my travels over the web I found this website - matrices can be your friends - and I would recommend that anyone who doesn't understand matrices to have a look at it! How about that, I bet you don't see many people actually researching topics by themselves around here do you? [wink] ...

what? >_<

##### Share on other sites
eh? what what?

I am building a camera class, I figured there is a lot of talk about quaternions so I may as well use them. Now the quaternion rotation matrix is [3][3] right, so does that mean that those values go into [0][1][2][4][5][6][8][9][10] in the [4][4] ([16]) OpenGL matrix?

##### Share on other sites
[00][04][08][12] | [00][01][02][03]
[01][05][09][13] | [04][05][06][07]
[02][06][10][14] | [08][09][10][11]
[03][07][11][15] | [12][13][14][15]

Should be somewhere along the lines of this, depending on whether you're using column-major or row-major matrices.

I use 4x4 in my quaterion class, simply filling the none-used rows/columns with 1s & 0s as appropriate.

[X][X][X][0]
[X][X][X][0]
[X][X][X][0]
[0][0][0][1]

This way all vectors/matrices are 4D and I don't have to switch constantly.

##### Share on other sites
I'm having the same problem, but I didn't understand that article at all. Even after the help on this site (and my own topic), matrices' practical use eludes me.

##### Share on other sites
Thanks wildfire that's exctly what I was talking about! yay!
I was actually thinking about using a [4][4] in my class but I'm hardly up to the programming yet, I've still a few more articles to read and I've dug up a lot of code to have a look at.

1. 1
2. 2
3. 3
4. 4
Rutin
16
5. 5

• 12
• 9
• 12
• 37
• 12
• ### Forum Statistics

• Total Topics
631419
• Total Posts
2999977
×