// guess ;) void RotateVertexX(TVector3D *pInput, TVector3D *pOutput, int Angle) { float tempy; TVector3D Out; tempy = pInput->y * FCOS (Angle) - pInput->z * FSIN (Angle); Out.z = pInput->y * FSIN (Angle) + pInput->z * FCOS (Angle); Out.x = pInput->x; Out.y = tempy; *pOutput = Out; }
void RotateVertexZ(TVector3D *pInput, TVector3D *pOutput, int Angle) { float tempx; TVector3D Out; tempx = (pInput->x * FCOS (Angle) - pInput->y * FSIN (Angle)); Out.y = (pInput->x * FSIN (Angle) + pInput->y * FCOS (Angle)); Out.x = tempx; Out.z = pInput->z; *pOutput = Out; }
void MIsss_Proj(float *p, int deg, float aspect, float znear, float zfar) { float tanparam = FSIN(deg) / FCOS(deg); float t = (float)(1.0 / tanparam); p[0] = t / aspect; p[1] = 0; p[2] = 0; p[3] = 0; p[4] = 0; p[5] = t; p[6] = 0; p[7] = 0; p[8] = 0; p[9] = 0; p[10] = (zfar + znear) / (znear - zfar); p[11] = -1; p[12] = 0; p[13] = 0; p[14] = (2 * zfar * znear) / (znear - zfar); p[15] = 0; }