I none to good at explaining stuff like this, so it probably doesn't make any sense. (or I may totally be off)
I'm just guessing from a quick glance at your code.
Hope I at least helped a bit.
I none to good at explaining stuff like this, so it probably doesn't make any sense. (or I may totally be off)
I'm just guessing from a quick glance at your code.
Hope I at least helped a bit.
void PrepVertex(CVertex* v, float xra, float yra, float zra)
{
float x = v->x;
float y = v->y;
float z = v->z;
float xr = v->x;
float yr = v->y;
float zr = v->z;
float xa = xra*3.14159/180;
float ya = yra*3.14159/180;
float za = zra*3.14159/180;
if(xra!=0){
yr = y*cos(xa) - z*sin(xa); // Rotate about X
zr = y*sin(xa) + z*cos(xa);
}
if(yra!=0){
xr = x*cos(ya) + z*sin(ya); // Rotate about Y
zr = x*-(sin(ya)) + z*cos(ya);
}
if(zra!=0){
xr = x*cos(za) - y*sin(za); // Rotate about Z
yr = x*sin(za) + y*cos(za);
}
v->xr = xr;
v->yr = yr;
v->zr = zr;
}