Thread: OpenGL - Lights behave strangely

  1. #1
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546

    Unhappy OpenGL - Lights behave strangely

    Hi all,

    I've recently started programming with OpenGL (I'd say about two weeks total) and everytime I go to use lights I get this weird behaviour from them.

    When my objects are rotating, the light shining on them seems to disappear. I somewhat suspect the lights are moving without me telling them to but I doubt that is the case.

    I'm uploading a copy of my current application in both binary and source form. The files are loaded through arguments to the executable (I find that dragging the file and dropping it onto the executable does the same result).

    Edit: I should probably mention that the models are the XML files (loaded using expat). Though that should be pretty obvious.

    -Frobozz
    Last edited by Frobozz; 06-04-2004 at 07:01 PM.

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    sorry Frobozz, but I can't run your app because it doesnt like my glut32 driver. Looking through your code, I can't spot anything right off the bat either. Do the lights ever reappear?

  3. #3
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    after another glance, and a look into your script files, you're not specifying the surface normal for your objects. I may be wrong, but I'm pretty sure that if you want to use positional and diffuse lighting, you have to provide one.

  4. #4
    Banned
    Join Date
    May 2004
    Posts
    129
    I also cannot run the program,
    "The procedure entry point __gluCreateMenuWithExit could not be located in the dynamic link library glu32.dll"

    Which perhaps means we are using different versions of the glut library. Can you check what version you have, or where you downloaded yours from?

    I also looked through the source, and as was mentioned, surface normals are not being set. The surface normals absolutely must be set, either once per triangle, or once per vertex, in order for OpenGL's lighting system to work properly.

    You have to calculate the normal vectors when you load the data in (or calculate it and save it to the file before writing it).

  5. #5
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Wow. You guys are good if you can fix the problem without being able to test what is wrong and without even seeing what is happening.

    As for the drivers I'm probably going to start including them in the zipfile. It'll raise the size a good amount but at least it should work.

    Edit: Okay maybe not that big after all. UPX managed to shrink the files to about one-half to one-third their original size.
    Last edited by Frobozz; 06-06-2004 at 11:33 AM.

  6. #6
    Banned
    Join Date
    May 2004
    Posts
    129
    It's a relatively simple problem too. There are other problems that are due to uncertainty, error, and the limitations of 32 bit floats :0

    those are truly horrible errors.

    I'm willing to download large files if it can help me help you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM