bob dylan
bob dylan

Reputation: 677

What is the purpose of using matrices in 3D graphics, such as OpenGL?

I've been messing around with OpenGL a little bit and I don't fully understand what the purpose of the matrices are for. Is it to provide animation for the objects or something?

Upvotes: 0

Views: 254

Answers (2)

MaKo
MaKo

Reputation: 786

For 3D vectors, 4x4 matrix stores nicely all the needed transforms (move, rotate, scale, and project) in one simple package. And not only that, you can cascade transformations together by simple multiply operation. I think that is the main reason for those. Of course, you can also have 3x3 rotation matrices, as well as quaternions involved in transforms: still, 4x4 matrix can store all those transforms, although extracting single operations out of that can be pretty tricky.

Upvotes: 0

user3821934
user3821934

Reputation:

Matrices are used to represent transformations of points and vectors in openGL. I suggest you brush up on some linear algebra, and, in particular, you learn about transformation matrices. You cannot be a good graphics programmer without understanding transformations!

Upvotes: 2

Related Questions