Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void renderScene()
- {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- if (buttonState == 1)
- {
- thetaU += xMousePositionDifference * xAngleInPixels * 0.1;
- thetaV += yMousePositionDifference * yAngleInPixels * 0.1;
- }
- if (buttonState == 2)
- {
- radiusStart += radiusDifference * yAngleInPixels;
- }
- gluLookAt(observerPosition[0], observerPosition[1], observerPosition[2], 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
- light_position[0] = radiusStart * cos(thetaU) * cos(thetaV);
- light_position[1] = radiusStart * sin(thetaV);
- light_position[2] = radiusStart * sin(thetaU) * cos(thetaV);
- glLightfv(GL_LIGHT0, GL_POSITION, light_position);
- Axes();
- Egg(50);
- glFlush();
- glutSwapBuffers();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement