GLfloat emission0[] = {0.0, 0.3, 0.3, 1.0};
GLfloat direction0[] = {0.0, 0.0, 0.0};
-GLfloat light0_pos[] ={10.0, 10.0, 0,0, 0.5};
+GLfloat light0_pos[] ={1.0, 1.0, 0,0, 0.5};
GLfloat shine = 100.0;
starty = y;\r
glutPostRedisplay();\r
}\r
+ if (lightMoving) {\r
+ lightAngle += (x - lightStartX)/40.0;\r
+ lightHeight += (lightStartY - y)/20.0;\r
+ lightStartX = x;\r
+ lightStartY = y;\r
+ glutPostRedisplay();\r
+ }\r
}\r
\r
/**\r
glLoadIdentity();\r
\r
gluLookAt(\r
- 0.0, 0.0, 5.0 + zoomFactor, /* eye is at (x,y,z) */\r
+ 0.0, 0.0, 5.0 + (zoomFactor*0.2), /* eye is at (x,y,z) */\r
0.0, 0.0, 0.0, /* center is at (x,y,z) */\r
0.0, 1.0, 0.0 /* up is in postivie Y direction */\r
);\r
\r
glRotatef(75.0, 1.0, 0.0, 0.0);\r
\r
+ /* Reposition the light source. */\r
+ lightPosition[0] = 12*cos(lightAngle);\r
+ lightPosition[1] = lightHeight;\r
+ lightPosition[2] = 12*sin(lightAngle);\r
+ lightPosition[3] = 0.0;\r
+\r
+\r
+ //glRotatef(angle, 0.0, 1.0, 0.0);\r
+ // glRotatef(angle2, 1.0, 0.0, 0.0);\r
+\r
glPushMatrix();\r
\r
/* Perform scene rotations based on user mouse/keyboard input. */\r
- glRotatef(rotateFactor, 0.0, 0.0, 1.0);\r
+ glRotatef(rotateFactor*0.2, 0.0, 1.0, 0.0);\r
//glTranslatef(camx, camy, camz);\r
//glRotatef(rot, 1.0, 0.0, 0.0);\r
\r