changeset 13:51e9b6b85edd

Fixed up rotation, now supports arbitrary rotation around, x, y, and z (in that order)
author Josef "Jeff" Sipek <jeffpc@optonline.net>
date Fri, 02 Dec 2005 23:04:10 -0500
parents 43c7ce2fc334
children 2da86c23f4f3
files rotate.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rotate.c	Thu Nov 24 04:39:25 2005 -0400
+++ b/rotate.c	Fri Dec 02 23:04:10 2005 -0500
@@ -7,9 +7,9 @@
 {
 	printf("%f %f %f\n"
 	       "%f %f %f\n"
-	       "%f %f %f", cos(omega), -sin(omega), 0.0,
-			   sin(omega), cos(omega), 0.0,
-			   0.0, 0.0, 1.0);
+	       "%f %f %f", cos(phi)*cos(rho), cos(rho)*sin(omega)*sin(phi)-cos(omega)*sin(rho), cos(omega)*cos(rho)*sin(phi)+sin(omega)*sin(rho),
+	       		   cos(phi)*sin(rho), cos(omega)*cos(rho)+sin(omega)*sin(phi)*sin(rho), -cos(rho)*sin(omega)+cos(omega)*sin(phi)*sin(rho),
+			   -sin(phi), cos(phi)*sin(omega), cos(omega)*cos(phi));
 }
 
 int main(int argc, char** argv)