Any help would be appreciated!
Code: Select all
Matrix4 Matrix4::Perspective(real angle, real imageAspectRatio, real n, real f)
{
real top = n * tan(Math::ToRadians(angle/2));
real bottom = -top;
real right = top*imageAspectRatio;
real left = -right;
return Matrix4(
(2*n)/(right-left), 0.0, 0.0, 0.0,
0.0, (2*n)/(top-bottom), 0.0, 0.0,
(right+left)/(right-left), (top+bottom)/(top-bottom), (-(f+n)/(f-n)), -1,
0.0, 0.0, (-2*f*n)/(f-n), 0.0
);
}
EDIT: Sorry guys, It actually ended up working fine, but another matrix was being multiplied into it on accident. Whoops.