Intro to 3D Graphics
a software renderer
Game Development Technology
an unreal modification
Console Development
a psp project

Sunday 12 October 2008

Vectors

My work this week has been on a Vector class for my software renderer. More functions will probably be added to do it as time goes on but now I have the basics, such as Dot Product, Cross Product, Normalisation and calculating the magnitude. I've also added operator overloads to compliment the operator functions (add, subtract, multiply and divide) which is easily done using:

Vector Vector::operator+(Vector rhs)
{
return Vector(_x + rhs.x, _y + rhs._y, _z + rhs._z);
}


I've done this for all the operators and also provided their +=/-= etc operators. Next up is Matrices which will give me the ability to transform a few test points into screen space, I hope!
With the vector class I also wrote a small test program to test every function to make sure it is working correctly. We also did a vector test during the tutorial which I think I did very well on.

No comments: