Jump to content
  • Advertisement
Sign in to follow this  
Eralp

Using Matrices

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have experiences in game programming(directx and opengl) and matrixes are the "must" for the game programming as far as I know.And I have read books and tutorials about them, and now I wonder if I could use them in other project than game programming.I need a new "aspect" for this though. For example if I had a picture of white and black pixels can I load it into an 2d array(Matrix?) and rotate it 90 180 or 270 degrees ? I know how to rotate a matrix about "given degrees" but it's a vague to me because I have never used em except the locations and such in games. And can I *reflect the matrixes in the middle with a shortcut trick(like multiplying it with another matrix) or should I calculate it in programm myself with a function? It would be greatly appreciated if someone guide me about these ^^ *(Reflection: The pattern was reflected horizontally (turned into a mirror image of itself by reflecting around a vertical line in the middle of the image))

Share this post


Link to post
Share on other sites
Advertisement
Matrices are simply a way of organizing your data into a 2D array. If you're familiar with the various operations on a matrix, you can use a combination of these to achieve a desired effect. The operations you choose depend on the way you store the data in your matrices.

The strength to matrix systems in 3d game engines is such as the similarity between matrix multiplication and dot products, the triangle represented by 3x3 matrix, the identity matrix representing an orthogonal basis, etc...

Say you had an image, with dimensions n x m. Say you wanted to rotate the image, as you said, 90, 180, or 270 degrees. You could simply take the transpose of your matrix n times, where n = degree of turn / 90. Of course, this only works for right angle turns.

I am not familiar with other uses of matrices outside of the game development area, although I've thought of some uses. Someone else would probably do a better job explaining that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!