Mail Archives: djgpp/1999/02/22/19:55:53
i've made a small modification to TransformObj(). when the object is
rotated, it seems as if the axis is located at screen coordinates 0, 0.
how do i select my own axis to rotate the object?
=======================================================================
void TransformObj(int mode, float x, float y, float z, Object *MyObject)
{
int counter;
float dummy; // use to hold useless z coordinate output, since 2d
(x, y) involve only
MATRIX_f TransMatrix; // Transformation Matrix
switch(mode) {
case TRANSLATEMODE:
get_translation_matrix_f(&TransMatrix, x, y, z);
break;
case SCALEMODE:
get_scaling_matrix_f(&TransMatrix, x, y, z);
break;
case ROTATEMODE:
get_rotation_matrix_f(&TransMatrix, x, y, z);
break;
}
for (counter = 0; counter < MyObject->NumOfVerts; counter++) {
apply_matrix_f(&TransMatrix,
MyObject->Coord[counter][0],
MyObject->Coord[counter][1], 0,
&MyObject->Coord[counter][0],
&MyObject->Coord[counter][1], &dummy);
}
}
--
regards,
lee.
===========================================================
figure out what to remove in email address. i tire of spam.
===========================================================
Suppose you were an idiot. And suppose you were a member of
Congress. But I repeat myself. -- Mark Twain
===========================================================
- Raw text -