Advertisement

Flashlight-esque light source in GL

Started by February 25, 2000 09:54 PM
-1 comments, last by OberonZ 25 years ago
Hello again, I''m trying to implement a flashlight like lightsource that can move around with a player, but I''m messing something up. I tried to do this: glLoadIdentity(); glTranslatef(0.0f,0.0f,z); GLfloat LightPosition[]={0.0f, 0.0f, 2.0f, 1.0f}; glLightfv(GL_LIGHT1, GL_POSITION,LightPosition); Where GL_LIGHT1 was inited like so: GLfloat LightDiffuse[]= {1.0f, 1.0f, 1.0f, 1.0f}; glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse); and where z is the position on the z axis (yes... you can only go down this corridor ) Unfortunately, this does not work... If anyone can tell me what I''m doing wrong I would appreciate it. (If you can tell me how and include a code snippet, I''d appreciate it even more >) -OberonZ ---
PAGE FAULT: Please insert "Swap File, Disk 2"
and press any key to continue.
---
PAGE FAULT: Please insert "Swap File, Disk 2"
and press any key to continue.

This topic is closed to new replies.

Advertisement