Advertisement
Charlesr456

gluLookAt Problem

Nov 12th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void display(void)
  2. {
  3.     glMatrixMode(GL_PROJECTION);
  4.     glLoadIdentity();
  5.     gluPerspective(40,1,near,far);
  6.    
  7.     glMatrixMode(GL_MODELVIEW);
  8.     glLoadIdentity();  
  9.     gluLookAt(0.0, 2.0, -3.0, 0.0, 0.0, 10.0, 0.0, 1.0, 0.0);
  10.        
  11.     glClear(GL_COLOR_BUFFER_BIT);  
  12.  
  13.     glPushMatrix();    
  14.         glColor3f (0.0, 0.0, 0.0);
  15.         glTranslatef(golfball.getpx(),golfball.getpy(),startdispz - golfball.getpz());
  16.         glutSolidSphere(golfball.getballsize(),20,20);
  17.     glPopMatrix(); 
  18.    
  19.     glPushMatrix();
  20.         glColor3f (0.0, 1.0, 0.0);
  21.         glTranslatef(0,0.0,-7.5);
  22.         glRotatef(90, 1.0, 0.0, 0.0);
  23.         drawCircle(0.1,24);
  24.         glRotatef(-90, 1.0, 0.0, 0.0);
  25.     glPopMatrix();
  26.    
  27.     glFlush();
  28.     glutSwapBuffers();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement