Skip to main content
gamedev.net
🔒 Locked

deriving a matrix

Started by me_here_me Jul 31, 2007 at 6:52 AM 4 replies 800+ views
Original Post
me_here_me
me_here_me
According to a paper that I am trying to implement, the following expression returns a 4x4 matrix.
[Source]
/*
                      Np                                T  
SumPY = (1/Np) { SUMMATION_SIGN [ (pi - MueP) (yi - MueY) ] }
                    i = 1

"T" stands for transpose and is on top of (yi - MueY)
"p", "y", "MueP", "MueY" are all 3D points {x, y, z}
"Np" is the number of points, currently I have 4.
*/
[/Source]
[/source][/source][/source] I am not able to understand that how should I get a 4x4 matrix out of the above expression? Help needed in correctly understanding the equation. thanks in advance
ToohrVyk
ToohrVyk
If X and Y are 3D vectors, then XYT is a 3x3 matrix. If you want a 4x4 matrix, I assume you're working with projective geometry, so you can add a fourth w=1 component to your vectors.
Kambiz
Kambiz
me_here_me
me_here_me
Thanks for the help.

and there is also a summation in question. Which of the following approaches is correct:

1.
[Source]/*                      Np                     p = (1/Np) { SUMMATION_SIGN [ (pi - MueP)  ] }                    i = 1                      Np                     y = (1/Np) { SUMMATION_SIGN [ (yi - MueY)  ] }                    i = 1          TSumPY = py*/[/Source]
[/source]


2. Or I generate a 4x4 matrix on each iteration on "i" and then add the matrices together at the end?

thanks for the help
Brother Bob
Brother Bob
Second one is correct. Expand for a few iterations and you will see that first is not correct, but second is.
sum i = 0 to 2  ==  (a0*b0) + (a1*b1) + (a2*b2) !=                !=  (a0+a1+a2) * (b0+b1+b2)

Exactly what the formula says. For each i, make a matrix and sum them for all i. The summation is over (pi-MueP)(yi-MueY)T, so that's what you sum.
me_here_me
me_here_me
thanks all for your help

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.