Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2115 in orxonox.OLD for orxonox/branches/chris/src/player.cc


Ignore:
Timestamp:
Jul 13, 2004, 10:49:20 AM (21 years ago)
Author:
chris
Message:

orxonox/branches/chris: Managed to apply all that rotating and translating so that you now actually see the debug player following the track. You can even steer the spaceship via the keys now… unfortunately the coordinate transformations are still a mess. Even though mapping from Locations to Placements seems to work in general, applying the finetuned position and rotation still messes up the whole damn thing…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/chris/src/player.cc

    r2112 r2115  
    6161void Player::command (Command* cmd)
    6262{
     63        printf("Player|recieved command [%s]\n", cmd->cmd);
    6364        if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp;
    6465        else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp;
     
    7172{
    7273        glMatrixMode(GL_MODELVIEW);
     74        glLoadIdentity();
    7375        float matrix[4][4];
    74   get_placement()->w.matrix (matrix);
    75   glLoadMatrixf ((float*)matrix);
    7676
    7777        glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
     78  get_placement()->w.matrix (matrix);
     79  glMultMatrixf ((float*)matrix);
    7880       
    7981        glBegin(GL_TRIANGLES);
    8082        glColor3f(1,0,0);
    81         glVertex3f(0,0,0);
     83        glVertex3f(0,0,0.5);
    8284        glColor3f(0,1,0);
    83         glVertex3f(-1,-0.5,0);
     85        glVertex3f(-0.5,0,-1);
    8486        glColor3f(0,0,1);
    85         glVertex3f(-1,+0.5,0);
     87        glVertex3f(0.5,0,-1);
    8688        glEnd();
    8789       
     
    123125       
    124126        velocity = velocity + (accel * time);
     127        printf("Player|velocity %f/%f/%f\n", velocity.x, velocity.y, velocity.z);
    125128}
    126129
Note: See TracChangeset for help on using the changeset viewer.