Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1917 in orxonox.OLD for orxonox/trunk/core/world.cc


Ignore:
Timestamp:
Jun 7, 2004, 9:32:51 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: ground moves

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/core/world.cc

    r1902 r1917  
    3232  lastNPC = null;
    3333  lastEnv = null;
     34  primitiveMove = 0;
    3435}
    3536
     
    163164      tmpNPC = tmpNPC->next;
    164165    }
     166
     167  glPushMatrix();
     168  glTranslatef(0.0, -primitiveMove, 0.0);
     169
    165170  /* now draw the rest of the world: environement */
    166171  envList* tmpEnv = lastEnv;
     
    170175      tmpEnv = tmpEnv->next;
    171176    }
    172 
    173  
    174   glColor3f(0.0, 1.0, 0.0);
    175  
     177 
     178 
     179  /* draw the ground grid  */
     180  glColor3f(0.0, 1.0, 0.0);
     181  glBegin(GL_LINES);
     182  /* for the moment, we've got only pseudo moving ground */
     183 for (int y = 0; y < 60; y += 2)
     184    {
     185      for (int x = 0; x < 60; x += 2)
     186        {
     187          glVertex3f((float)(x - 30), (float)(y - 30), surface[x][y]);
     188          glVertex3f((float)(x - 28), (float)(y - 30), surface[x+2][y]);
     189        }
     190    }
     191 glEnd();
     192  glPopMatrix();
     193 
    176194  glBegin(GL_LINES);
    177195  for (int x = 0; x < 60; x += 2)
     
    184202    }
    185203  glEnd();
    186  
    187  
    188   glBegin(GL_LINES);
    189   for (int y = 0; y < 60; y += 2)
    190     {
    191       for (int x = 0; x < 60; x += 2)
    192         {
    193           glVertex3f((float)(x - 30), (float)(y - 30), surface[x][y]);
    194           glVertex3f((float)(x - 28), (float)(y - 30), surface[x+2][y]);
    195         }
    196     }
    197   glEnd();
    198  
     204
     205
     206  primitiveMove+=0.1;
    199207}
    200208
Note: See TracChangeset for help on using the changeset viewer.