#include <GL/glut.h>
#include <math.h>
#include <stdio.h>
Go to the source code of this file.
◆ pi
◆ display()
Definition at line 42 of file torus.c.
44 glClear(GL_COLOR_BUFFER_BIT);
46 glColor3f(1.0, 1.0, 1.0);
47 glutWireTorus(0.5, 3, 15, 30);
Referenced by main().
◆ init()
Definition at line 66 of file torus.c.
67 glClearColor(0.0, 0.0, 0.0, 1.0);
68 glColor3f(1.0, 1.0, 1.0);
70 glMatrixMode(GL_PROJECTION);
72 gluPerspective(60.0, 4.0 / 3.0, 1, 40);
74 glMatrixMode(GL_MODELVIEW);
76 gluLookAt(4, 6, 5, 0, 0, 0, 0, 1, 0);
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 79 of file torus.c.
80 glutInit(&argc, argv);
81 glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
84 glutInitWindowPosition(80, 80);
85 glutInitWindowSize(1000, 800);
86 glutCreateWindow(
"A Torus on a Plane");
References display(), and init().