#include <GL/glut.h>
#include <math.h>
#include <stdio.h>
Go to the source code of this file.
◆ pi
◆ display()
Definition at line 10 of file openGL_torus.c.
12 glClear(GL_COLOR_BUFFER_BIT);
14 glColor3f(1.0, 1.0, 1.0);
15 glutWireTorus(0.5, 3, 15, 30);
Referenced by main().
◆ init()
Definition at line 34 of file openGL_torus.c.
35 glClearColor(0.0, 0.0, 0.0, 1.0);
36 glColor3f(1.0, 1.0, 1.0);
38 glMatrixMode(GL_PROJECTION);
40 gluPerspective(60.0, 4.0 / 3.0, 1, 40);
42 glMatrixMode(GL_MODELVIEW);
44 gluLookAt(4, 6, 5, 0, 0, 0, 0, 1, 0);
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 47 of file openGL_torus.c.
48 glutInit(&argc, argv);
49 glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
52 glutInitWindowPosition(80, 80);
53 glutInitWindowSize(1000, 800);
54 glutCreateWindow(
"A Torus on a Plane");
References display(), and init().