int main (int argc, char *argv[])
{
}
int main (int argc, char *argv[])
{
int window;
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
glutDisplayFunc (&DrawGLScene);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
glutDisplayFunc (&DrawGLScene);
glutIdleFunc (&DrawGLScene);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
glutDisplayFunc (&DrawGLScene);
glutIdleFunc (&DrawGLScene);
glutReshapeFunc (&ReSizeGLScene);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
glutDisplayFunc (&DrawGLScene);
glutIdleFunc (&DrawGLScene);
glutReshapeFunc (&ReSizeGLScene);
InitGL (1280, 1024);
}
int main (int argc, char *argv[])
{
int window;
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize (1280, 1024);
glutInitWindowPosition (0, 0);
window = glutCreateWindow ("Drawing a circle");
glutDisplayFunc (&DrawGLScene);
glutIdleFunc (&DrawGLScene);
glutReshapeFunc (&ReSizeGLScene);
InitGL (1280, 1024);
glutMainLoop();
}
void InitGL (int width, int height)
{
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
glMatrixMode (GL_PROJECTION);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
gluPerspective (45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f);
}
void InitGL (int width, int height)
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth (1.0);
glDepthFunc (GL_LESS);
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
gluPerspective (45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f);
glMatrixMode (GL_MODELVIEW);
}
void ReSizeGLScene (int width, int height)
{
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
glViewport (0, 0, width, height);
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
gluPerspective (45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f);
}
void ReSizeGLScene (int width, int height)
{
if (height == 0)
{
height = 1;
}
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
gluPerspective (45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f);
glMatrixMode (GL_MODELVIEW);
}
void DrawGLScene ()
{
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
for (theta_degrees = 0.0f; theta_degrees < 360.0f; theta_degrees += 5.0f)
{
}
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
for (theta_degrees = 0.0f; theta_degrees < 360.0f; theta_degrees += 5.0f)
{
theta_radians = theta_degrees * M_PI / 180.0f;
}
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
for (theta_degrees = 0.0f; theta_degrees < 360.0f; theta_degrees += 5.0f)
{
theta_radians = theta_degrees * M_PI / 180.0f;
glVertex3f (center_x + cos(theta_radians) * radius, center_y + sin(theta_radians) * radius, 0.0f);
}
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
for (theta_degrees = 0.0f; theta_degrees < 360.0f; theta_degrees += 5.0f)
{
theta_radians = theta_degrees * M_PI / 180.0f;
glVertex3f (center_x + cos(theta_radians) * radius, center_y + sin(theta_radians) * radius, 0.0f);
}
glEnd();
}
void DrawGLScene ()
{
float center_x, center_y, theta_degrees, theta_radians, radius, iterations;
center_x = 320.0f;
center_y = 220.0f;
glColor3ub (255, 255, 0);
glPolygonMode (GL_FRONT, GL_FILL);
glBegin (GL_POLYGON);
for (theta_degrees = 0.0f; theta_degrees < 360.0f; theta_degrees += 5.0f)
{
theta_radians = theta_degrees * M_PI / 180.0f;
glVertex3f (center_x + cos(theta_radians) * radius, center_y + sin(theta_radians) * radius, 0.0f);
}
glEnd();
glFlush();
}
#include <GL/glut.h>
#include <math.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include <math.h>
cc -o circle circle.c -lglut -lGL -lGLU -lX11 -lXmu -lXi -lm
cc -o circle circle.c -framework GLUT -framework OpenGL -framework Cocoa -lm -Wno-deprecated
Fall 2016, CS-116A:
Lectures:
Assignments:
Handouts:
Programs: