- Timestamp:
- Jul 13, 2004, 10:49:20 AM (20 years ago)
- Location:
- orxonox/branches/chris/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/camera.cc
r2112 r2115 87 87 // TO DO: implement options for frustum generation 88 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); 89 //Vector up(0,0,1); 90 //Vector dir(1,0,0); 91 //Quaternion q(dir,up); 92 //float matrix[4][4]; 93 //q.conjugate().matrix (matrix); 94 //glMultMatrixf ((float*)matrix); 95 //glTranslatef (10,0,-5); 96 // 97 //dir = Vector(-1,-1,0); 98 //q = Quaternion( dir, up); 99 //glMatrixMode (GL_MODELVIEW); 100 //glLoadIdentity (); 101 //q.matrix (matrix); 102 //glMultMatrixf ((float*)matrix); 103 //glTranslatef (2,2,0); 104 // 105 //glBegin(GL_TRIANGLES); 106 //glColor3f(1,0,0); 107 //glVertex3f(0,0,0.5); 108 //glColor3f(0,1,0); 109 //glVertex3f(-0.5,0,-1); 110 //glColor3f(0,0,1); 111 //glVertex3f(0.5,0,-1); 112 //glEnd(); 113 94 114 // rotation 95 115 float matrix[4][4]; -
orxonox/branches/chris/src/camera.h
r2112 r2115 26 26 void update_desired_place (); 27 27 28 float h;29 30 28 public: 31 29 Camera (); -
orxonox/branches/chris/src/command_node.cc
r2105 r2115 194 194 void CommandNode::relay (Command* cmd) 195 195 { 196 p error("CommandNode|relay()");196 printf("CommandNode|relay()\n"); 197 197 List<WorldEntity>* plist = bound; 198 198 … … 204 204 while( (plist = plist->get_next()) != NULL) 205 205 { 206 (plist->get_object())->command (cmd);206 plist->get_object()->command (cmd); 207 207 } 208 208 } -
orxonox/branches/chris/src/orxonox.cc
r2112 r2115 253 253 return true; 254 254 } 255 return false; 255 256 } 256 257 -
orxonox/branches/chris/src/player.cc
r2112 r2115 61 61 void Player::command (Command* cmd) 62 62 { 63 printf("Player|recieved command [%s]\n", cmd->cmd); 63 64 if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp; 64 65 else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp; … … 71 72 { 72 73 glMatrixMode(GL_MODELVIEW); 74 glLoadIdentity(); 73 75 float matrix[4][4]; 74 get_placement()->w.matrix (matrix);75 glLoadMatrixf ((float*)matrix);76 76 77 77 glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z); 78 get_placement()->w.matrix (matrix); 79 glMultMatrixf ((float*)matrix); 78 80 79 81 glBegin(GL_TRIANGLES); 80 82 glColor3f(1,0,0); 81 glVertex3f(0,0,0 );83 glVertex3f(0,0,0.5); 82 84 glColor3f(0,1,0); 83 glVertex3f(- 1,-0.5,0);85 glVertex3f(-0.5,0,-1); 84 86 glColor3f(0,0,1); 85 glVertex3f( -1,+0.5,0);87 glVertex3f(0.5,0,-1); 86 88 glEnd(); 87 89 … … 123 125 124 126 velocity = velocity + (accel * time); 127 printf("Player|velocity %f/%f/%f\n", velocity.x, velocity.y, velocity.z); 125 128 } 126 129 -
orxonox/branches/chris/src/track.cc
r2112 r2115 50 50 51 51 camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0); 52 camplc->w = Quaternion( (trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r), Vector(0,0,1));52 camplc->w = Quaternion(Vector(0,0,0) - ((trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r)), Vector(0,0,1)); 53 53 54 54 } … … 69 69 Quaternion dir(trace.a, Vector(0,0,1)); 70 70 71 plc->r = trace.r + (trace.a * ((loc->dist) / l)) + dir.apply(loc->pos);71 plc->r = trace.r + (trace.a * ((loc->dist) / l)) + /*dir.apply*/(loc->pos); 72 72 plc->w = dir * loc->rot; 73 73 -
orxonox/branches/chris/src/world.cc
r2112 r2115 94 94 glLoadIdentity(); 95 95 glBegin(GL_LINES); 96 glColor3f(1,0,0);97 /* for( float x = -128.0; x < 128.0; x += 5.0) 98 {99 for( float y = -128.0; y < 128.0; y += 5.0)100 {96 for( float x = -128.0; x < 128.0; x += 25.0) 97 { 98 for( float y = -128.0; y < 128.0; y += 25.0) 99 { 100 glColor3f(1,0,0); 101 101 glVertex3f(x,y,-128.0); 102 glVertex3f(x,y,0.0); 103 glColor3f(0.5,0,0); 104 glVertex3f(x,y,0.0); 102 105 glVertex3f(x,y,128.0); 103 106 } 104 107 } 105 glColor3f(0,1,0);106 for( float y = -128.0; y < 128.0; y += 5.0)107 {108 for( float z = -128.0; z < 128.0; z += 5.0)109 {108 for( float y = -128.0; y < 128.0; y += 25.0) 109 { 110 for( float z = -128.0; z < 128.0; z += 25.0) 111 { 112 glColor3f(0,1,0); 110 113 glVertex3f(-128.0,y,z); 114 glVertex3f(0.0,y,z); 115 glColor3f(0,0.5,0); 116 glVertex3f(0.0,y,z); 111 117 glVertex3f(128.0,y,z); 112 118 } 113 119 } 114 glColor3f(0,0,1);115 for( float x = -128.0; x < 128.0; x += 5.0)116 {117 for( float z = -128.0; z < 128.0; z += 5.0)118 {120 for( float x = -128.0; x < 128.0; x += 25.0) 121 { 122 for( float z = -128.0; z < 128.0; z += 25.0) 123 { 124 glColor3f(0,0,1); 119 125 glVertex3f(x,-128.0,z); 126 glVertex3f(x,0.0,z); 127 glColor3f(0,0,0.5); 128 glVertex3f(x,0.0,z); 120 129 glVertex3f(x,128.0,z); 121 130 } 122 } */131 } 123 132 //draw track 124 133 glColor3f(0,1,1);
Note: See TracChangeset
for help on using the changeset viewer.