I am currently taking a course on basics of computer graphics and in this task I am asked to construct a 3d object(e.g a cylinder), I am currently studying an example but I am stuck on the code fragment that converts from 3d to 2d. I can't find any mathematical explanation of the formula being used and I will like to understand how the fragment works,
Here is the code fragment that converts
private Point Convert_3D_To_2D_Point(Point3D point)
{
double xPoint = -point._z * Math.Sin(3.14) + point._x * Math.Cos(3.14) + centre.X;
double yPoint = -(point._z * System.Math.Cos(3.14) + point._x * System.Math.Sin(3.14)) * System.Math.Sin(1.0) + point._y * System.Math.Cos(1.0) + centre.Y;
return new Point((int)(xPoint), (int)(yPoint));
}
I figured out a 4 * 4 matrix from this function
Cos A 0 -sin A x0
-SinA * SinB -CosB -Cos(A) y0
0 0 0 0
0 0 0 1
This matrix wasn't part of the different projection matrices we studied in the class and I'm having trouble finding such a transformation matrix online I will like to know how the matrix works, what I can study to have a full understanding of what's going on.