float scp[18][3] = {
{
1.000000, 0.000000, 0.000000
- },
+ },
{
1.000000, 0.000000, 5.000000
},
{
0.707107, 0.707107, 0.000000
- },
+ },
{
0.707107, 0.707107, 5.000000
},
{
0.000000, 1.000000, 0.000000
- },
+ },
{
0.000000, 1.000000, 5.000000
},
{
-0.707107, 0.707107, 0.000000
- },
+ },
{
-0.707107, 0.707107, 5.000000
},
{
-1.000000, 0.000000, 0.000000
- },
+ },
{
-1.000000, 0.000000, 5.000000
},
{
-0.707107, -0.707107, 0.000000
- },
+ },
{
-0.707107, -0.707107, 5.000000
},
{
0.000000, -1.000000, 0.000000
- },
+ },
{
0.000000, -1.000000, 5.000000
},
{
0.707107, -0.707107, 0.000000
- },
+ },
{
0.707107, -0.707107, 5.000000
},
{
1.000000, 0.000000, 0.000000
- },
+ },
{
1.000000, 0.000000, 5.000000
},
static float back_mat_diffuse[] = {1.0, 0.0, 0.0, 1.0};
static float lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0};
static float fog_color[] = {0.8, 0.8, 0.8, 1.0};
-
+
glFrontFace(GL_CW);
glEnable(GL_DEPTH_TEST);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
-
+
glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
GLint i;
rgb = GL_TRUE;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-ci") == 0) {
} else {
glDisable(GL_LINE_STIPPLE);
}
-
+
if (mode2) {
ci = CI_OFFSET;
glEnable(GL_LINE_SMOOTH);
GLint i;
rgb = GL_TRUE;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-ci") == 0) {
* Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc.
*/
-/*
+/*
* Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows
* 6/13
*
pi = 3.14159265358979323846;
twopi = 2 * pi;
-
+
for (i = 0; i < numc; i++) {
glBegin(GL_QUAD_STRIP);
for (j = 0; j <= numt; j++) {
}
glPushMatrix();
-
+
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
gluLookAt(0,0,10, 0,0,0, 0,1,0);
dests[GREENRING][1] = bottom_y;
dests[GREENRING][2] = bottom_z;
- base = 2.0;
+ base = 2.0;
height = 2.0;
theTorus = glGenLists(1);
glNewList(theTorus, GL_COMPILE);
GLint i;
rgb = GL_TRUE;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-ci") == 0) {
{
GLint i;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
{
{
1.0, 1.0, -1.0
- },
+ },
{
0.0, 1.0, -1.0
},
},
{
-1.0, 1.0, -1.0
- },
+ },
{
-1.0, 0.0, -1.0
- },
+ },
{
0.0, 0.0, -1.0
},
{
-1.0, 0.0, -1.0
},
- },
+ },
{
{
-1.0, 1.0, 0.0
{
-1.0, 0.0, 0.0
},
- },
+ },
{
{
-1.0, 0.0, 1.0
{
-1.0, 0.0, 0.0
},
- },
+ },
{
{
-1.0, -1.0, 0.0
{
-1.0, 0.0, 0.0
},
- },
+ },
},
{
{
void BuildCylinder(int numEdges)
{
int i, top = 1.0, bottom = -1.0;
- float x[100], y[100], angle;
-
+ float x[100], y[100], angle;
+
for (i = 0; i <= numEdges; i++) {
angle = i * 2.0 * PI / numEdges;
x[i] = cos(angle); /* was cosf() */
pi = 3.14159265358979323846;
twopi = 2.0 * pi;
-
+
glNewList(torus, GL_COMPILE);
for (i = 0; i < numc; i++) {
glBegin(GL_QUAD_STRIP);
left = -4.0;
bottom = -4.0;
right = 4.0;
- top = 4.0;
+ top = 4.0;
inc = 2.0 * 4.0 * 0.1;
glNewList(cube, GL_COMPILE);
for (i = 0; i < 6; i++) {
for (j = 0; j < 4; j++) {
- glNormal3fv(n[i]);
+ glNormal3fv(n[i]);
glBegin(GL_POLYGON);
glVertex3fv(c[i][j][0]);
glVertex3fv(c[i][j][1]);
glGetIntegerv(GL_BLUE_BITS, &blueBits);
deepestColor = (redBits >= greenBits) ? COLOR_RED : COLOR_GREEN;
- deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE;
+ deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE;
}
void SetDefaultSettings(void)
image->data = AlphaPadImage(image->sizeX*image->sizeY,
image->data, 128);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
- image->sizeX, image->sizeY,
+ gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
+ image->sizeX, image->sizeY,
GL_RGBA, GL_UNSIGNED_BYTE, image->data);
} else {
image = LoadPPM(imageFileName);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
- image->sizeX, image->sizeY,
+ gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
+ image->sizeX, image->sizeY,
GL_RGB, GL_UNSIGNED_BYTE, image->data);
}
-
+
glFogf(GL_FOG_DENSITY, 0.125);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, 4.0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
glLightfv(GL_LIGHT0, GL_POSITION, position);
-
+
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
if (autoRotate) {
xRotation += .75;
yRotation += .375;
- }
+ }
glutSwapBuffers();
}
{
GLint i;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
numComponents = 4;
for (i = 1; i < argc; i++) {
{
GLint i;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
{
GLint i;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
glColor3fv(facet->color);
} else {
thisColor = facet->color;
- glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES,
+ glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES,
facet->color);
}
} else {
}
}
-static void SetColorMap(void)
+static void SetColorMap(void)
{
static float green[3] = {0.2, 1.0, 0.2};
static float red[3] = {1.0, 0.2, 0.2};
glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
-
+
glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
-
+
glFrontFace(GL_CW);
glEnable(GL_DEPTH_TEST);
GLint i;
rgb = GL_TRUE;
- doubleBuffer = GL_FALSE;
+ doubleBuffer = GL_TRUE;
frames = 10;
widthX = 10;
widthY = 10;