My work this week has been on the Matrix class for my software renderer. Much like the Vector class, it currently has most of the basic functions for Matrix arithmetic as well as building matrices. However it is missing functionality for creating view and projection matrices which will be added soon and give me the ability to draw some nice perspective 3d graphics from some basic vectors with GDI.
I've also created a static variable within the class to hold the identity matrix which will come in useful creating matrices from it. As to be expected there's also a method to output a string to console of the value of the Matrix.
Showing posts with label intro-to-3d-graphics. Show all posts
Showing posts with label intro-to-3d-graphics. Show all posts
Wednesday, 22 October 2008
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:
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.
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.
Saturday, 11 October 2008
GDIPlus
This week I've been playing around with GDIPlus, the windows graphics drawing library as a bit of an experiment and to get back into C++. Despite a few annoyances, it went pretty well and I had a line drawn on screen pretty quickly. But that was boring....so I delved into the Time class to make my own clock with a bit of simple maths, though converting an angle on the clock to an angle usable in cos/sin to get the 2nd point of the lines proved a little awkward.
I'm definitely looking forward to the rest of this module. I'm a self confessed graphics whore and I spent a lot of last year doing work for fun which I get graded for this year. I hope to expand upon our software renderer with a few things I picked up working with HLSL last year, such as spiffy environment mapping, shadow mapping and normal mapping. But I guess I'll need to finish the software renderer first before I can worry about using the blitter for more than just drawing transfomed, lit polys.
Subscribe to:
Posts (Atom)
About Me
- knighty
- I'm a computer games programming student currently studying at the University of Derby