Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1917 in orxonox.OLD for orxonox/trunk


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

orxonox/trunk: ground moves

Location:
orxonox/trunk/core
Files:
1 added
4 edited

Legend:

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

    r1896 r1917  
    2828{
    2929
     30
     31  for (int x = 0; x < 10; x++)
     32    {
     33      for (int y = 0; y < 10; y++)
     34        {
     35          mountainTest[x][y] = 0;
     36                                                 
     37        }
     38    }
     39
    3040  for (int x = 1; x < 9; x++)
    3141    {
     
    5464 
    5565  glBegin(GL_LINES);
    56   for (int x = 0; x < 10; x += 1)
     66  for (int x = 0; x < 9; x += 1)
    5767    {
    58       for (int y = 0; y < 10; y += 1)
     68      for (int y = 0; y < 9; y += 1)
    5969        {
    6070          glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
     
    6676 
    6777  glBegin(GL_LINES);
    68   for (int y = 0; y < 10; y += 1)
     78  for (int y = 0; y < 9; y += 1)
    6979    {
    70       for (int x = 0; x < 10; x += 1)
     80      for (int x = 0; x < 9; x += 1)
    7181        {
    7282          glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]);
  • orxonox/trunk/core/orxonox.cc

    r1902 r1917  
    134134void Orxonox::timeSlice(int value)
    135135{
    136   cout << "got " << fps << endl;
     136  cout << "got " << fps << " fps" << endl;
    137137  /* this is very very unsafe: io could be uninit */
    138138  io->setPlayerStep(19.2 / fps); /* set player to propper speed */
  • 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
  • orxonox/trunk/core/world.h

    r1904 r1917  
    2020  World ();
    2121  ~World ();
     22
     23  float primitiveMove;
    2224
    2325  /* for easier use: map the first two player here */
Note: See TracChangeset for help on using the changeset viewer.