(no commit message)
authorAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:40:23 +0000 (20:40 +0800)
committerAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:40:23 +0000 (20:40 +0800)
scene.c

diff --git a/scene.c b/scene.c
index 0841edd..1bafde5 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -674,11 +674,17 @@ void init() {
      far   /* Z far */\r
     );    \r
 \r
-  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);\r
-  glLightfv(GL_LIGHT0, GL_AMBIENT|GL_SPECULAR|GL_DIFFUSE, lightColor);\r
-  glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1);\r
-  glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05);\r
-  glEnable(GL_LIGHT0);\r
+\r
+GLfloat diffuse0[] = {1.0, 0.0, 0.0, 1.0};\r
+GLfloat ambient0[] = {1.0, 0.0, 0.0, 1.0};\r
+GLfloat specular0[] = {1.0, 0.0, 0.0, 1.0};\r
+GLfloat light0_pos[] ={ 1.0, 2.0, 3,0, 1.0};\r
+\r
+glEnable(GL_LIGHT0);\r
+glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);\r
+glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);\r
+glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);\r
+glLightfv(GL_LIGHT0, GL_SPECULAR, specular0);\r
   glEnable(GL_LIGHTING);\r
 \r
   glMatrixMode(GL_MODELVIEW);\r

UCC git Repository :: git.ucc.asn.au