Changeset 2112 in orxonox.OLD for orxonox/branches/chris/src/camera.cc
- Timestamp:
- Jul 12, 2004, 10:28:25 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/camera.cc
r2100 r2112 30 30 { 31 31 bound = NULL; 32 desired_place.r = Vector (0,0,0);33 desired_place.w = Rotation (0,0,0);34 actual_place.r = Vector (0,0,0);35 actual_place.w = Rotation (0,0,0);36 32 } 37 33 … … 53 49 { 54 50 update_desired_place (); 51 jump (NULL); 55 52 } 56 53 … … 73 70 { 74 71 desired_place.r = Vector (0,0,0); 75 desired_place.w = Rotation (0,0,0);72 desired_place.w = Quaternion (); 76 73 } 77 74 } … … 86 83 { 87 84 glMatrixMode (GL_PROJECTION); 85 glLoadIdentity (); 88 86 // view 89 87 // TO DO: implement options for frustum generation 90 glFrustum( -1.0,1.0,-1.0,1.0,1.5,20.0); 88 glFrustum( -1.0,1.0,-1.0,1.0,1.5,250.0); 89 glRotatef(h,1,0,0); 90 glRotatef(h/2,0,1,0); 91 glRotatef(h/4,0,0,1); 92 h += 3; 93 // glRotatef(90,0,0,1); 91 94 // rotation 92 float matrix[ 16];93 actual_place.w. glmatrix (matrix);94 gl LoadMatrixf (matrix);95 float matrix[4][4]; 96 actual_place.w.conjugate().matrix (matrix); 97 glMultMatrixf ((float*)matrix); 95 98 // translation 96 glTranslatef ( actual_place.r.x, actual_place.r.y,actual_place.r.z);99 glTranslatef (-actual_place.r.x, -actual_place.r.y,- actual_place.r.z); 97 100 98 101 glMatrixMode (GL_MODELVIEW); 99 102 glLoadIdentity (); 103 104 printf("Camera@%f/%f/%f\n",actual_place.r.x,actual_place.r.y,actual_place.r.z); 105 Vector unique(1,0,0); 106 Vector test = actual_place.w.apply (unique); 107 printf("Camera&%f/%f/%f\n", test.x, test.y, test.z); 100 108 } 101 109
Note: See TracChangeset
for help on using the changeset viewer.