I am constructing a hand held game system out of an atmega328p chip. I have basic functions written for this chip to write to my portable screen such as drawline, drawrect, drawcirc, fillrect, fillcirc, drawpoint, etc. I am attempting to create a basic 3D engine for this system using lines to imitate 3D wireframe graphics. I know that to do this, I need to calculate where the line endpoints would be to give perspective, however, I do not know where to start with these algorithms. How would I write a function that would create a line in 3D virtual space and convert it to a 2D image?
Something like:
void drawline3(int x, int y, int z)
{
//calculate line position
drawline(x, y); //draw the line as a 2D line
}
P.S. I am new to the forums, so if this is posted in the completely wrong place, I apologize.