Lighting

I am not the best GL programmer so there may well be a simple explanation for this…
I have a sphere (glut) and have mapped surface normlas to it (gl vertex), so it looks like a fuzzy ball. It has one light. When I rotate the ball (and normals) using the mouse the ball is illuminated as if the light is stationary, but the normals are illuminated as if the light is being rotated with the scene. Any ideas??

gav

Originally posted by Gavin:
I am not the best GL programmer so there may well be a simple explanation for this…
I have a sphere (glut) and have mapped surface normlas to it (gl vertex), so it looks like a fuzzy ball. It has one light. …snip…
gav

Hi, Gav, could you send a code snippet what
are you exactly doing ???
adios, dariusz

Well there is a fair bit of code in all so I have put the codewarrior project on the web http://www.cs.cf.ac.uk/user/G.R.Powell/OpenGL

I would be really grateful if you could download it and have a quick look. Don’t use any args.

gav

Gavin,
I believe glut calculates normals for geometric primitives (like glutWireSphere()) automatically. I’m still getting a grip on lighting, so I’m not completely sure about this, but if you are specifying a normals for an object that already has them, that may be the source of the problem. I’m downloading your project, so I’ll take a look and see if I can be any more help. David jswa@earthlink.net.

I don’t specify any normals for my objects, perhaps my post was misleading in that way. I have a glut sphere on which I have drawn protruding gl lines (which represent the normals of an object) its not for modelling as such just data visualisation, infact its a Gaussian Sphere.

gav

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.