Archived

This topic is now archived and is closed to further replies.

How?

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

Recommended Posts

I was wondering how do people find about ,say, projective shadows or textures. I mean, that involves lots of operations with matrices (modelview, projection , etc), so how do they know that , for example, the process for achieving correct result is through inverse of view matrix times transpose of that, etc. What result gives you, for example, inverse of matrix, or its transpose, how you can use it? For example, if I got OpenGL type modelview matrix, what will give me the, for example, the transpose of it? Sorry for lack of informative statements, I''m just not sure how to ask. Thanks. " Do we need us? "

Share on other sites
if you have the modelview opengl matrix stored, and you want the transpose, make the transpose, its something like this

void MatrixTranspose (GLfloat m1[16],GLfloat m2[16])
{
m2[0] = m1[0];
m2[4] = m1[1];
m2[8] = m1[2];
m2[12] = m1[3];

m2[1] = m1[4];
m2[5] = m1[5];
m2[9] = m1[6];
m2[13] = m1[7];

m2[2] = m1[8];
m2[6] = m1[9];
m2[10] = m1[10];
m2[14] = m1[11];

m2[3] = m1[12];
m2[7] = m1[13];
m2[11] = m1[14];
m2[15] = m1[15];
}

Share on other sites
it can be easily optimized with sse

Share on other sites
It isn''t clear if you mean how do you derive matrix equations in general or what is the matrix equation or how do you perform the operations the equation specifies. A shadow projection matrix is a good example of how to derive a matrix equation from a vector equation, but it isn''t clear if that is what you are asking.

Share on other sites
What I''m asking is that. Assume that you have to integrate velocity. (Integral of vdt) it will give you the distance travelled.
Or for example, you use Adobe Photoshop, and apply ,say, some effect that WILL GIVE YOU the expected outcome.
Here, with matrices, I do not understand the result it gives me when I take transpose or inverse of matrix, I do not understand (and I don''t see) the result and where I can use it.

Thanks.

" Do we need us? "

Share on other sites
Are you asking "how these people can come up with those formulas?" In matrices, the transpose of a matrix is a matrix, and the inverse of a matrix is also a matrix, and you are wondering how these people know that the multiplication of the transpose and the inverse of a matrix can help you achieving the result you want. Is that what you are asking?

Current project: 2D in Direct3D engine.
% completed: ~20%

Share on other sites
if you want to understand what matrices are and when you can use them and such things, learn Linear Algebra. you could buy a textbook or look for online tutorials, or take a class. you should really do that anyway if you''re going to be doing 3D engine work. it will help you immensely

-me

Share on other sites
You are rightr, allnite, thats what I''m after. How do they know that by modifying matrices they WILL get the desired effect?

And I''m already know what matrices are and what are they used for, Palidine.

Thanks.

" Do we need us? "

Share on other sites
There is a set of rules, more precisely axiom, postulates and theorems. Just like regular algebra. The most basic is that you can multiply both sides of an equation by equal values without changing the truth of the statement. Similarly for adding equal values to both sides. Linear algebra adds in matrices and vectors which leads to how to represent equations using matrices and vectors. Then manipulation leads to certain observations and definitions. One such is that the process of solving a linear equation leads to process called the inverse. So you have a definition that gives you a simple way to state that procedure. That then lets you make statements like (M^-1)*M=I and since I*N=N you can conclude that if M*V=V'' then V=(M^-1)V''. Another is that A*B=(B^T*A^T)^T. Mainly handy for rearranging equations. As an example A*B*C=A*(C^T*B^T)^T=B*C*A^T. The goal often being to get constant matrices together so that you can combine them similar to 2*x*3*x=6*x.

1. 1
2. 2
3. 3
4. 4
Rutin
15
5. 5

• 14
• 9
• 10
• 12
• 17
• Forum Statistics

• Total Topics
632910
• Total Posts
3009174
• Who's Online (See full list)

There are no registered users currently online

×