PDA

View Full Version : basic lighting question



ewans2
05-20-2003, 06:31 AM
I want to use gluCylinder(..) in my scene. If i read the glu documentation right the cylinder is smooth shaded by default but in order to see the smooth shading i will have to light the cylinder, otherwise itís just a flat shape with now definition and concept of depth/form.

Problem is this, if the draw the cylinder in a solid colour, say RED, when lit, I need the cylinder to appear as close to RED at all times from whatever angle, the colour change from the lighting should be minimal.

Is there are simple way to approach this with lighting, what options will give me the desired results ? Or is there another approach.

ta
ewan

jebus
05-20-2003, 07:17 AM
you should read up on using OpenGL materials. material properties are used to determine a vertex's color when lit. you can also enable color tracking which will use the color you supply to glColor*() as the vertex material color.

jebus

errno
05-21-2003, 12:32 AM
in opengl material, there are 4 colors.
ambient, diffuse, specular, emissive.
opengl compute the diffuse and specular parts and sum all the component.
if your diffuse and specular parts have small luminance, the computed color will be near the ambient+emissive value.