Advertisement

Matrix??

Started by February 13, 2002 10:36 PM
1 comment, last by FERNANDO-BRASIL 23 years ago
Hi guys!!!! I''m a OpenGL programmer, and I would like to know in what Matrix (and Quaternions) help in the final result (in the visual results)!!! (I don''t want to know how to use them, but yes how the APIs programmers use that) I know we can store the position, the scaling and the rotation in a matrix... But I would like to know, how the APIs programmers use Matrixs to Paint the final Image to the screen, since that all they have are simple Numbers representing things!! What is the math fórmula for this? thank you, and sorry for my bad english! (i''m brazillian)
OK, I''m not very good with this sort of thing so some of it may be incorrect, but ... here goes.

Matrices are primarily used for the transformation of points and polygons etc in a world. They are not responsible for painting anything to the screen (as far as I know). When you multiply points by them, the result is a newly transformed point, transformed by all the transformations that are in the matrix. In OpenGL there are 3 main matrices. The MODELVIEW matrix (used for transforming objects around in a world), the PROJECTION matrix (used for applying perspective to a scene) and the VIEWPORT matrix (which maps the 2D projection of the scene into the rendering window). Points are first put through the MODELVIEW matrix to position them in the world. The world is then put through the PROJECTION matrix to add perspective. When the flattened 2D image is created it is then put through the VIEWPORT matrix to map it correctly to the window.

I also don''t know any formula''s off the top of my head, sorry.

I don''t know if this will help much, hope it does.

- Weasalmongler
Advertisement
You probably want to run some demos that are especially designed to show what matrices and quaternions are all about. The NeHe tutorials at nehe.gamedev.net are going to be good resources.

I particularly like Nate Robins' tutorials, which actually visualize things like the view frustum. Doesn't really cover matrices and quaternions though:

http://www.xmission.com/~nate/tutors.html

There is a SIGGRAPH course called "Visualizing Quaternions." A powerpoint presentation is available here:

http://www.cs.indiana.edu/pub/hanson/.epfl/VQ2vis.ppt

Unfortunately the powerpoint file is missing the pictures, which makes it sort of useless. But you may be able to find a version with pictures online. Just search on "Visualizing Quaternions."

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on February 14, 2002 2:40:56 PM
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement