PDA

View Full Version : Lighting



Gavin
02-09-2001, 06:49 AM
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

rangaroek
02-12-2001, 12:09 AM
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

Gavin
02-12-2001, 12:40 AM
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

02-12-2001, 06:45 AM
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.

Gavin
02-12-2001, 03:16 PM
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