Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2933 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Nov 20, 2004, 7:00:25 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: mousewheel-zoom

Location:
orxonox/trunk/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/framework.cc

    r2932 r2933  
    11#include "framework.h"
    22
    3 int verbose = 4;
     3int verbose = 1;
    44
    55void DrawGLScene()
     
    1212  glMatrixMode(GL_PROJECTION);
    1313  glLoadIdentity();     
    14   gluPerspective(45.0f,500/375,0.1f,100.0f);
    15   gluLookAt (5*sin(rotatorP),7.5,5*cos(rotatorP), 0,0,0, 0,1,0);
     14  gluPerspective(45.0f,500/375,0.1f,dist * 5.0f);
     15  gluLookAt (dist*sin(rotatorP),dist ,dist*cos(rotatorP), 0,0,0, 0,1,0);
    1616
    1717  obj->draw();
     
    6262  rotatorP = .0;
    6363  rotatorV = .0;
     64  dist = 5.0;
    6465  // Build the font from a TGA image font.tga in the data directory
    6566  // Hide the mouse cursor
     
    8384      case SDL_MOUSEBUTTONDOWN:
    8485        if (event.button.button == 4)
    85           printf("MouseWheel up\n");
     86          {
     87            printf("MouseWheel up\n");
     88            dist *= .5;
     89          }
    8690        else if (event.button.button == 5)
    87           printf("MouseWheel down\n");
     91          {
     92            printf("MouseWheel down\n");
     93            dist *= 2;
     94          }
    8895        else
    8996          {
  • orxonox/trunk/importer/framework.h

    r2932 r2933  
    88float rotatorP;
    99float rotatorV;
     10float dist;
    1011
    1112WindowHandler wHandler;  // Create an instance of the whandler basecode class
Note: See TracChangeset for help on using the changeset viewer.