SHARE
TWEET

Untitled

a guest Nov 20th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void renderScene()
  2. {
  3.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  4.     glLoadIdentity();
  5.     if (buttonState == 1)
  6.     {
  7.             thetaU += xMousePositionDifference * xAngleInPixels * 0.1;
  8.             thetaV += yMousePositionDifference * yAngleInPixels * 0.1;
  9.     }
  10.     if (buttonState == 2)
  11.     {
  12.             radiusStart += radiusDifference * yAngleInPixels;
  13.     }
  14.     gluLookAt(observerPosition[0], observerPosition[1], observerPosition[2], 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  15.     light_position[0] = radiusStart * cos(thetaU) * cos(thetaV);
  16.     light_position[1] = radiusStart * sin(thetaV);
  17.     light_position[2] = radiusStart * sin(thetaU) * cos(thetaV);
  18.     glLightfv(GL_LIGHT0, GL_POSITION, light_position);
  19.     Axes();
  20.     Egg(50);
  21.  
  22.  
  23.     glFlush();
  24.     glutSwapBuffers();
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top