Hi everyone, I emailed this to Mike and he suggested I post this here.
I had a question regarding the Mat4x4 class referenced here:
code.google.com/p/gamecode4/so…CC4/Graphics3D/Geometry.h
In a few methods, SetPosition for example, we set the position values as follows:
inline void Mat4x4::SetPosition(Vec3 const &pos)
{
m[3][0] = pos.x;
m[3][1] = pos.y;
m[3][2] = pos.z;
m[3][3] = 1.0f;
}
According to msdn.microsoft.com/en-us/libra…op/bb172573(v=vs.85).aspx the matrix is set up as m[ i ][ j ] with i being the row and j being the column of the matrix. Should we not be setting the matrix as m[0][3] = x, m[1][3] = y.. etc. so that the last column of the matrix is filled in?
Also, in the Scaling methods, we SET scale like this:
m[1][1] = scale.x;
m[2][2] = scale.y;
m[3][3] = scale.z;
but GET scale like this:
return Vec3(m[0][0], m[1][1], m[2][2]);
I believe the indices in the GETTER method are the right indices for the scale values of a 4x4 matrix.
Thanks!
I had a question regarding the Mat4x4 class referenced here:
code.google.com/p/gamecode4/so…CC4/Graphics3D/Geometry.h
In a few methods, SetPosition for example, we set the position values as follows:
inline void Mat4x4::SetPosition(Vec3 const &pos)
{
m[3][0] = pos.x;
m[3][1] = pos.y;
m[3][2] = pos.z;
m[3][3] = 1.0f;
}
According to msdn.microsoft.com/en-us/libra…op/bb172573(v=vs.85).aspx the matrix is set up as m[ i ][ j ] with i being the row and j being the column of the matrix. Should we not be setting the matrix as m[0][3] = x, m[1][3] = y.. etc. so that the last column of the matrix is filled in?
Also, in the Scaling methods, we SET scale like this:
m[1][1] = scale.x;
m[2][2] = scale.y;
m[3][3] = scale.z;
but GET scale like this:
return Vec3(m[0][0], m[1][1], m[2][2]);
I believe the indices in the GETTER method are the right indices for the scale values of a 4x4 matrix.
Thanks!