Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

outputOpengl.h File Reference

Go to the source code of this file.

Defines

#define X   0
#define Y   1
#define Z   2
#define PI   3.14159

Functions

void DrawHand ( )
 Draws the navigation hand. More...

void DrawMatrix (float size, float number)
 DrawMatrix draws the matrix. More...

void display (void)
 The display function. More...

void init (void)
void reshape (int x, int y)
 reshape function. More...

void idlefunc ()
 The idle function. More...

void IntToString (int x, char text[])
 IntToString Converts an integer to a string. More...

void printstring (void *font, char *string)
 printstring prints an string into the opengl scenery. More...

void DrawStat (void)
 DrawStat a primitive HUD-Like thing. More...


Variables

float campos [3] = { 0.0, 15.0, 500.0 }
float lookto [3] = { 0.0, 0.0, 0.0 }
float upvect [3] = { 0.0, 1.0, 0.0 }
float lookdir [3] = { 0.0, 0.0, 1.0 }
int NeedRedraw = 0
int framecounter = 0
int WINDOWX = 800
int WINDOWY = 600
float speed = 1.0 / 5.0
float speednr = 5.0


Define Documentation

#define PI   3.14159

Definition at line 8 of file outputOpengl.h.

#define X   0

Definition at line 4 of file outputOpengl.h.

#define Y   1

Definition at line 5 of file outputOpengl.h.

#define Z   2

Definition at line 6 of file outputOpengl.h.


Function Documentation

void DrawHand ( void)

Draws the navigation hand.

Definition at line 29 of file outputOpengl.cpp.

00030 {
00031     float finger = -0.05;
00032     float length = -0.1;
00033 
00034     glMaterialfv(GL_FRONT,GL_DIFFUSE,m_hand);
00035 
00036     glBegin(GL_LINES);
00037         glVertex3f(0.0,0.0,0.05);
00038         glVertex3f(0.0,0.0,0.1);
00039     glEnd();
00040 
00041     glBegin(GL_LINES);
00042         glVertex3f(-0.05,0.0,0.05);
00043         glVertex3f(0.05,0.0,0.05);
00044         glVertex3f(-0.05,0.0,0.05);
00045         glVertex3f(-0.05,0.0,-0.05);
00046         glVertex3f(0.05,0.0,0.05);
00047         glVertex3f(0.05,0.0,-0.05);
00048         glVertex3f(-0.05,0.0,-0.05);
00049         glVertex3f(0.05,0.0,-0.05);
00050     glEnd();
00051 
00052         glBegin(GL_LINES);
00053             glVertex3f(-0.05,0.0,-0.05);
00054             glVertex3f(-0.05,0.0,-0.15);
00055 
00056             glVertex3f(0.05,0.0,-0.05);
00057             glVertex3f(0.05,0.0,-0.1);
00058             glVertex3f(0.05,0.0,-0.1);
00059             glVertex3f(0.05,finger,length);
00060 
00061             glVertex3f(0.02,0.0,-0.05);
00062             glVertex3f(0.02,0.0,-0.1);
00063             glVertex3f(0.02,0.0,-0.1);
00064             glVertex3f(0.02,finger,length);
00065 
00066             glVertex3f(-0.01,0.0,-0.05);
00067             glVertex3f(-0.01,0.0,-0.1);
00068             glVertex3f(-0.01,0.0,-0.1);
00069             glVertex3f(-0.01,finger,length);
00070 
00071             glVertex3f(-0.05,0.0,-0.05);
00072             glVertex3f(-0.07,0.0,-0.05);
00073             glVertex3f(-0.07,0.0,-0.05);
00074             glVertex3f(-0.07,-0.05,-0.02);
00075 
00076         glEnd();
00077     }

void DrawMatrix ( float size,
float number)

DrawMatrix draws the matrix.

Parameters:
size   The size of the whole matrix
number   the number of matrix-sectors

Definition at line 87 of file outputOpengl.cpp.

00088 {
00089     float x,y,z;
00090     float step;
00091 
00092     step = size/number;
00093 
00094     y = 0.0;
00095 
00096     GLfloat m_matrixA[] = { 0.593, 0.726, 0.961, 1.0 };
00097     GLfloat m_matrixB[] = { 0.277, 0.347, 0.496, 1.0 };
00098 
00099     glMaterialfv(GL_FRONT,GL_DIFFUSE,m_matrixA);
00100 
00101     for ( x=0.0; x <= size; x += step)
00102         {
00103         glBegin(GL_LINES);
00104         glNormal3f(0.0,1.0,0.0);
00105             glVertex3f(size-x*2,y,-size);
00106             glVertex3f(size-x*2,y,size);
00107         glEnd();
00108         }
00109 
00110     for ( z=0.0; z <= size; z += step)
00111         {
00112         glBegin(GL_LINES);
00113         glNormal3f(0.0,1.0,0.0);
00114             glVertex3f(-size,y,size-z*2);
00115             glVertex3f(size,y,size-z*2);
00116         glEnd();
00117         }
00118 
00119     step = size/(number*3.0);
00120 
00121     glMaterialfv(GL_FRONT,GL_DIFFUSE,m_matrixB);
00122 
00123     for ( x=0.0; x <= size; x += step)
00124         {
00125         glBegin(GL_LINES);
00126         glNormal3f(0.0,1.0,0.0);
00127             glVertex3f(size-x*2,y,-size);
00128             glVertex3f(size-x*2,y,size);
00129         glEnd();
00130         }
00131 
00132 
00133     for ( z=0.0; z <= size; z += step)
00134         {
00135         glBegin(GL_LINES);
00136         glNormal3f(0.0,1.0,0.0);
00137             glVertex3f(-size,y,size-z*2);
00138             glVertex3f(size,y,size-z*2);
00139         glEnd();
00140         }
00141 
00142     }

void DrawStat ( void)

DrawStat a primitive HUD-Like thing.

Definition at line 204 of file outputOpengl.cpp.

00205 {
00206     char text[40];
00207 
00208     glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_hud );
00209 
00210     glRasterPos2i(1,WINDOWY-40);
00211     printstring(GLUT_BITMAP_TIMES_ROMAN_24,"The Matrix");
00212 
00213     glRasterPos2i(1,1);
00214     printstring(GLUT_BITMAP_TIMES_ROMAN_24,"Matrix:");
00215 
00216     IntToString ( 0, text );
00217     glRasterPos2i(80,1);
00218     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00219     IntToString ( 0, text );
00220     glRasterPos2i(110,1);
00221     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00222     IntToString ( 0, text );
00223     glRasterPos2i(140,1);
00224     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00225 
00226     IntToString ( (int) campos[X], text );
00227     glRasterPos2i(200,1);
00228     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00229     IntToString ( (int) campos[Y], text );
00230     glRasterPos2i(255,1);
00231     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00232     IntToString ( (int) campos[Z], text );
00233     glRasterPos2i(310,1);
00234     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00235 
00236     IntToString ( colObject , text );
00237     glRasterPos2i(420,1);
00238     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00239 
00240     IntToString ( myObjectID , text );
00241     glRasterPos2i(490,1);
00242     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00243 
00244     IntToString ( (int)(speednr*10) , text );
00245     glRasterPos2i(560,1);
00246     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00247 
00248     IntToString ( frametime, text );
00249     glRasterPos2i(WINDOWX-40,WINDOWY-40);
00250     printstring(GLUT_BITMAP_TIMES_ROMAN_24,text);
00251     }

void IntToString ( int x,
char text[])

IntToString Converts an integer to a string.

Parameters:
x   the integer
text   the char* where it shall be written into

Definition at line 151 of file outputOpengl.cpp.

00152 {
00153     int i=0,j=10;
00154 
00155     if ( x == 0)
00156         {
00157         text[0] = '0';
00158         text[1] = '\0';
00159         }
00160     else
00161         {
00162         i = 0;
00163         if ( x < 0 )
00164             {
00165             text[0] = '-';
00166             x = x * -1;
00167             i++;
00168             }
00169 
00170         for ( j = x; j > 0; j = j / 10, i++);
00171 
00172         i--;
00173         text[i+1] = '\0';
00174 
00175         for ( ; x > 0; x = x / 10, i--)
00176             {
00177             text[i] = (char) ( x % 10 + '0');
00178             }
00179         }
00180     }

void display ( void)

The display function.

Author(s):
xandi
Date:
????98/99
See also:
Object

Definition at line 392 of file visualThread.cpp.

00393 {
00394     glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
00395 
00396     glShadeModel( GL_SMOOTH);
00397 
00398     glMaterialfv( GL_FRONT, GL_SPECULAR,  m_specular );
00399     glMaterialfv( GL_FRONT, GL_SHININESS, m_shininess );
00400     glMaterialfv( GL_FRONT, GL_EMISSION,  m_emission );
00401 
00402     glLightfv ( GL_LIGHT0, GL_AMBIENT,  l_ambient );
00403     glLightfv ( GL_LIGHT0, GL_DIFFUSE,  l_diffuse );
00404     glLightfv ( GL_LIGHT0, GL_POSITION, l_position );
00405     glLightfv ( GL_LIGHT0, GL_SPECULAR, l_specular );
00406 
00407     glPushMatrix ();
00408 
00409         glDisable(GL_BLEND);
00410 
00411         #ifdef DEBUG
00412         fprintf(stderr,"[vT] - %f %f %f\n",campos[X],campos[Y],campos[Z]);
00413         fprintf(stderr,"[vT] - %f %f %f\n",lookto[X],lookto[Y],lookto[Z]);
00414         fprintf(stderr,"[vT] - %f %f %f\n",upvect[X],upvect[Y],upvect[Z]);
00415         #endif
00416 
00417         gluLookAt ( campos[X], campos[Y], campos[Z],
00418                     lookto[X], lookto[Y], lookto[Z],
00419                     upvect[X], upvect[Y], upvect[Z]);
00420 
00421 
00422         glScalef (1.0, 1.0, 1.0);
00423 
00424         glCallList(Scene);
00425 
00426         glMaterialfv( GL_FRONT, GL_DIFFUSE, m_green );
00427 
00428         glBegin(GL_TRIANGLE_STRIP);
00429             glNormal3f(1.0,0.0,0.0);
00430             glVertex3f(-50.0,0.0,-50.0);
00431             glVertex3f(50.0,0.0,-50.0);
00432             glNormal3f(0.0,1.0,0.0);
00433             glVertex3f(0.0,50.0,0.0);
00434             glVertex3f(0.0,0.0,50.0);
00435             glNormal3f(0.0,0.0,1.0);
00436             glVertex3f(-50.0,0.0,-50.0);
00437         glEnd();
00438 
00439         if ( !haveenvironment )
00440             glCallList ( environment );
00441 
00442         typedef map<int,Object>::const_iterator objectIt;
00443 
00444         for ( objectIt o = Objects.begin(); o != Objects.end(); ++o)
00445             {
00446             const double *pos = o->second.pos;
00447 
00448             #ifdef DEBUG3
00449             fprintf(stderr,"[%d]-[%f][%f][%f]--[%d]\n",o->first,pos[0],pos[1],pos[2],o->second.visualData.length());
00450             #endif
00451 
00452 
00453             if ( !o->second.havedata ) continue;
00454 
00455                 if ( o->first == myObjectID )
00456                     {
00457                     if ( !showme )
00458                         continue;
00459                     }
00460 
00461             glPushMatrix();
00462 
00463                 glTranslated(pos[0],pos[1],pos[2]);
00464                 glCallList ( o->second.visual);
00465 
00466                 glRasterPos2i (0,0);
00467                 printstring (GLUT_BITMAP_TIMES_ROMAN_24, const_cast<char*>(o->second.chat_msg.c_str()));
00468 
00469             glPopMatrix ();
00470             }
00471 
00472 
00473         glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_green );
00474 
00475         // SHOWS LIGHTSOURCES:
00476         #ifdef DEBUG_3D
00477         glPushMatrix();
00478         glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_lamp );
00479 
00480         glTranslatef(l_position[0],l_position[1],l_position[2]);
00481         glRotatef(myRotate,1.0,1.1,1.4);
00482 
00483         glutWireSphere ( 20.0, 10, 10 );
00484         glPopMatrix();
00485         #endif
00486 
00487         DrawCursor();
00488 
00489     glPopMatrix();
00490 
00491     glShadeModel(GL_FLAT);
00492     glMatrixMode(GL_PROJECTION);
00493 
00494     glPushMatrix();
00495 
00496         glLoadIdentity();
00497         glOrtho(-0.5,799.5,-0.5,579.5,-1.0,1.0);
00498         glMatrixMode(GL_MODELVIEW);
00499         glLoadIdentity();
00500 
00501 
00502         DrawStat();
00503 
00504         glPushMatrix ();
00505             glColor3f (1.0, 1.0, 1.0);
00506             glRasterPos2i (20,100);
00507             printstring (GLUT_BITMAP_TIMES_ROMAN_24, const_cast<char*>(chatmsg.c_str()));
00508         glPopMatrix ();
00509 
00510         glMatrixMode(GL_PROJECTION);
00511 
00512     glPopMatrix();
00513 
00514     glMatrixMode(GL_MODELVIEW);
00515 
00516     glutSwapBuffers();
00517     }

void idlefunc ()

The idle function.

Author(s):
xandi
Date:
130400

Definition at line 664 of file visualThread.cpp.

00665 {
00666     gettimeofday(&t1,NULL);
00667 
00668     if ( t1.tv_sec - t2.tv_sec > 0 )
00669         {
00670         frametime = framecounter;
00671         framecounter = 0;
00672         t2.tv_sec = t1.tv_sec;
00673         devasks = 0;
00674 
00675         if ( frametime < 25 )
00676             qObj->setFrequency ( frametime ); //WHY DOES THERE COME A FLOATING POINT EXCEPTION WHEN I USE qObj->setFrequency ( frametime )??
00677         else
00678             qObj->setFrequency ( 25 );
00679 
00680         }
00681     framecounter++;
00682 
00683     devices.update ();
00684 
00685     if ( ( devfreq.tv_usec * devasks ) < t1.tv_usec )
00686         {
00687         if (devices.eventStatus (MOVE_FORWARD)) {
00688             #ifdef DEBUG
00689             cerr << "MOVE_FORWARD\n";
00690             #endif
00691 
00692             if ( colObject < 0 )
00693                 {
00694                 packet* pak = new packet;
00695                 pak->h.header[0] = PROT_OUTPUT_VISUAL;
00696                 pak->h.header[1] = VISUAL_CAMERA_MOVE;
00697                 pak->h.header[2] = INPUT_FORWARD;
00698 
00699                 coreBufferIn->write (pak);
00700                 }
00701         };
00702 
00703         if (devices.eventStatus (MOVE_BACKWARD)) {
00704             #ifdef DEBUG
00705             cerr << "MOVE_BACKWARD\n";
00706             #endif
00707 
00708             packet* pak = new packet;
00709             pak->h.header[0] = PROT_OUTPUT_VISUAL;
00710             pak->h.header[1] = VISUAL_CAMERA_MOVE;
00711             pak->h.header[2] = INPUT_BACKWARD;
00712 
00713             coreBufferIn->write (pak);
00714         };
00715 
00716         if (devices.eventStatus (ROTATE_UP)) {
00717             #ifdef DEBUG
00718             cerr << "ROTATE_UP\n";
00719             #endif
00720 
00721             deviceY -= (int) (devices.eventStatus (ROTATE_UP) * 5.0);
00722 
00723             if ( deviceY <= 0 )
00724                 deviceY = (WINDOWY - deviceY) % WINDOWY;
00725 
00726             ChangeCamLookTo(deviceX,deviceY);
00727         };
00728 
00729         if (devices.eventStatus (ROTATE_DOWN)) {
00730             #ifdef DEBUG
00731             cerr << "ROTATE_DOWN\n";
00732             #endif
00733 
00734             deviceY += (int) (devices.eventStatus (ROTATE_DOWN) * 5.0);
00735 
00736             if ( deviceY >= WINDOWY )
00737                 deviceY = deviceY % WINDOWY;
00738 
00739             ChangeCamLookTo(deviceX,deviceY);
00740         };
00741 
00742         if (devices.eventStatus (ROTATE_LEFT)) {
00743             #ifdef DEBUG
00744             cerr << "ROTATE_LEFT\n";
00745             #endif
00746 
00747             deviceX -= (int) (devices.eventStatus (ROTATE_LEFT) * 5.0);
00748 
00749             if ( deviceX <= 0)
00750                 deviceX = (WINDOWX + deviceX) % WINDOWX;
00751 
00752             ChangeCamLookTo(deviceX,deviceY);
00753         };
00754 
00755         if (devices.eventStatus (ROTATE_RIGHT)) {
00756             #ifdef DEBUG
00757             cerr << "ROTATE_RIGHT\n";
00758             #endif
00759 
00760             deviceX += (int) (devices.eventStatus (ROTATE_RIGHT) * 5.0);
00761 
00762             if ( deviceX >= WINDOWX)
00763                 deviceX = deviceX % WINDOWX;
00764 
00765             ChangeCamLookTo(deviceX,deviceY);
00766         };
00767 
00768         devasks++;
00769         }
00770 
00771 
00772     if (devices.eventStatus (CHAT_MODE)) {
00773         char c = (char) (devices.eventStatus (CHAT_MODE) * 32767);
00774         c++;
00775         #ifdef DEBUG
00776         cerr << "CHAT_MODE: " <<  c << " " << (int) c << "\n";
00777         #endif
00778 
00779         if (c == 13) {
00780             packet* pak = new packet;
00781             pak->h.header[0] = PROT_TEXT_MSG;
00782             pak->data = chatmsg;
00783 
00784             coreBufferIn->write (pak);
00785 
00786             chatmsg = "";
00787         } else if ((c == 8) && (chatmsg.length () > 0)) {
00788             chatmsg = chatmsg.substr (0, chatmsg.length () - 1);
00789         } else {
00790             chatmsg += c;
00791         };
00792 
00793     };
00794 
00795     if (devices.eventStatus (EXIT_CLIENT)) {
00796         cerr << "EXIT_CLIENT\n";
00797 
00798         packet* pak = new packet;
00799         pak->h.header[0] = PROT_KILL_CLIENT;
00800 
00801         coreBufferIn->write (pak);
00802         exit (0);
00803     };
00804 
00805 
00806     myRotate += ROTATESTEP;
00807     if ( myRotate >= 360.0 ) myRotate = 0.0;
00808 
00809     if ( !myInBuffer->isEmpty() )
00810         {
00811         #ifdef DEBUG
00812         fprintf(stderr,"[vT] got a packet!\n");
00813         #endif
00814         packet* pak;
00815         pak = myInBuffer->read ();
00816 
00817         switch ( pak->h.header[0] )
00818             {
00819             case VISUAL_CAMERA_MOVE:
00820                 {
00821                 #ifdef DEBUG
00822                 fprintf(stderr,"[vT] VISUAL_CAMERA_MOVE\n");
00823                 #endif
00824                 if ( pak->h.header[1] == INPUT_FORWARD )
00825                     {
00826                     ChangeCamPos( 'f' );
00827                     }
00828                 else
00829                     {
00830                     ChangeCamPos( 'b' );
00831                     }
00832 
00833                 pak = new packet;
00834 
00835                 char* temp;
00836                 double tempPos[3];
00837 
00838                 tempPos[0] = campos[0];
00839                 tempPos[1] = campos[1];
00840                 tempPos[2] = campos[2];
00841 
00842                 temp = new char[sizeof(double)*3];
00843                 memcpy ( temp, &tempPos, sizeof(double)*3);
00844 
00845 
00846                 pak->h.header[0] = PROT_CHANGE_POSITION;
00847                 pak->data.assign (temp, sizeof(double)*3);
00848 
00849                 coreBufferIn->write (pak);
00850 
00851                 NeedRedraw = 1;
00852                 break;
00853                 }
00854 
00855             case VISUAL_CAMERA_LOOKTO:
00856                 {
00857                 #ifdef DEBUG
00858                 fprintf(stderr,"[vT] VISUAL_CAMERA_LOOKTO\n");
00859                 #endif
00860                 ChangeCamLookTo(pak->h.header[2],pak->h.header[3]);
00861                 NeedRedraw = 1;
00862 
00863                 delete pak;
00864                 break;
00865                 }
00866 
00867             case VISUAL_NEW_OBJECT:
00868                 {
00869                 /************************************
00870                 h.header[1] ObjectID
00871                 data        name
00872                 ************************************/
00873                 #ifdef DEBUG2
00874                 fprintf(stderr,"[vT] getting a new object - %d - %d\n", pak->h.header[1],pak->data.length());
00875                 #endif
00876 
00877                 Objects[pak->h.header[1]].name = pak->data;
00878 
00879                 #ifdef DEBUG2
00880                 cerr << "Thats the object: \n" << pak->data;
00881                 #endif
00882 
00883                 delete pak;
00884                 break;
00885                 }
00886 
00887             case VISUAL_MY_OBJECT:
00888                 {
00889                 myObjectID = pak->h.header[2];
00890                 break;
00891                 }
00892 
00893             case VISUAL_TURN_AVATAR_OFF:
00894                 {
00895                 showme = !showme;
00896                 break;
00897                 }
00898 
00899             case VISUAL_NEW_ATOM:
00900                 {
00901                 /**************************************
00902                 h.header[1] ObjectID
00903                 h.header[2] atomType
00904                 h.header[3] atomID
00905                 h.header[4] valueType
00906                 data        The atom data
00907                 **************************************/
00908 
00909                 #ifdef DEBUG4
00910                 fprintf(stderr,"[vT] New Atom (%d) type %d - for object %d - %d\n",pak->h.header[3],pak->h.header[2],pak->h.header[1],pak->data.length());
00911                 #endif
00912 
00913                 switch ( pak->h.header[2] )
00914                     {
00915                     case AT_CHATMSG:
00916                         {
00917                         dismsg = pak->data;
00918 
00919                         cerr << dismsg << " ...\n";
00920                         Objects[pak->h.header[1]].chat_msg = pak->data;
00921 
00922                         delete pak;
00923                         break;
00924                         }
00925 
00926                     case AT_POSITION:
00927                         {
00928 
00929                         double *pos = Objects[pak->h.header[1]].pos;
00930                         memcpy ( pos, pak->data.data(), sizeof(double)*3 );
00931 
00932                         #ifdef DEBUG2
00933                         fprintf(stderr,"pos ausgabe:\n");
00934                         fprintf(stderr,"%d %f,%f,%f\n",pak->h.header[1]
00935                                                       ,Objects[pak->h.header[1]].pos[0]
00936                                                       ,Objects[pak->h.header[1]].pos[1]
00937                                                       ,Objects[pak->h.header[1]].pos[2]);
00938                         #endif
00939 
00940                         delete pak;
00941                         break;
00942                         }
00943 
00944                     case AT_3DSIAGRAPH:
00945                         {
00946                         if ( pak->h.header[1] < 0 )
00947                             {
00948                             environment = glGenLists (1);
00949 
00950                             glNewList(environment,GL_COMPILE);
00951                                 parseObject ( pak->data );
00952                             glEndList();
00953 
00954                             haveenvironment = true;
00955                             }
00956                         else
00957                             {
00958                             Objects[pak->h.header[1]].visual = glGenLists (1);
00959 
00960                             glNewList(Objects[pak->h.header[1]].visual,GL_COMPILE);
00961 
00962                                 Objects[pak->h.header[1]].hull = parseObject ( pak->data );
00963 
00964                             glEndList();
00965 
00966                             Objects[pak->h.header[1]].havedata = true;
00967                             }
00968 
00969                         delete pak;
00970                         break;
00971                         }
00972 
00973                     default:
00974                         {
00975                         fprintf(stderr,"[vT] THIS CANNOT BE!! IT CAN'T!!\n");
00976                         delete pak;
00977                         exit(1);
00978                         break;
00979                         }
00980                     }
00981                 break;
00982                 }
00983 
00984             default:
00985                 {
00986                 #ifdef DEBUG
00987                 fprintf(stderr,"[vT] heey, DEFAULT IS BORING!!!!\n");
00988                 #endif
00989                 break;
00990                 }
00991 
00992             }
00993         }
00994 
00995 
00996     lookto[X] = lookdir[X] + campos[X];
00997     lookto[Y] = lookdir[Y] + campos[Y];
00998     lookto[Z] = lookdir[Z] + campos[Z];
00999 
01000     glutPostRedisplay();
01001     }

void init ( void)

Definition at line 57 of file client/frontends/qt/qtFrontEnd.cpp.

00058 {
00059     fprintf ( stderr, "\n3Dsia client\nQt configuration frontend plugin\n" );
00060     }

void printstring ( void * font,
char * string)

printstring prints an string into the opengl scenery.

Parameters:
font   the type of font
string   the text-string

Definition at line 189 of file outputOpengl.cpp.

00190 {
00191     int len,i;
00192 
00193     len = (int) strlen(string);
00194 
00195     for( i = 0; i < len; i++)
00196         glutBitmapCharacter(font,string[i]);
00197     }

void reshape ( int x,
int y)

reshape function.

Author(s):
xandi
Date:
????98/99

Definition at line 600 of file visualThread.cpp.

00601 {
00602     glMatrixMode(GL_PROJECTION);
00603     glLoadIdentity();
00604     gluPerspective(70.0,1.0*x/y,1.0,5000.0);
00605     glMatrixMode(GL_MODELVIEW);
00606     glLoadIdentity();
00607     glViewport(0,0,x,y);
00608 
00609     float percX = (float)x / (float)WINDOWX;
00610     float percY = (float)y / (float)WINDOWY;
00611 
00612 //fix me pleeease!!
00613     WINDOWX = x;
00614     WINDOWY = y;
00615 
00616     deviceX = (int)( (float)deviceX * percX);
00617     deviceY = (int)( (float)deviceY * percY);
00618     ChangeCamLookTo(deviceX,deviceY);
00619     }

Variable Documentation

int NeedRedraw = 0

Definition at line 18 of file outputOpengl.h.

int WINDOWX = 800

Definition at line 21 of file outputOpengl.h.

int WINDOWY = 600

Definition at line 22 of file outputOpengl.h.

float campos[3] = { 0.0, 15.0, 500.0 }

Definition at line 13 of file outputOpengl.h.

int framecounter = 0

Definition at line 19 of file outputOpengl.h.

float lookdir[3] = { 0.0, 0.0, 1.0 }

Definition at line 16 of file outputOpengl.h.

float lookto[3] = { 0.0, 0.0, 0.0 }

Definition at line 14 of file outputOpengl.h.

float speed = 1.0 / 5.0

Definition at line 24 of file outputOpengl.h.

float speednr = 5.0

Definition at line 25 of file outputOpengl.h.

float upvect[3] = { 0.0, 1.0, 0.0 }

Definition at line 15 of file outputOpengl.h.


Generated at Sat May 13 13:50:21 2000 for 3Dsia by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000