
One step forward
Posted Friday, 6 January, 2012 - 09:08 by StMarkThis is the continuation of my last blog, so I made one step further
Just commented out
GL.Material(MaterialFace.Front, MaterialParameter.Ambient, new Color4(0.3f + 0.7f * c * c, 0.3f + 1.4f * c * c, 0.7f - 0.7f * c * c, 1.0f)); //GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Diffuse, new Color4(0.3f + 0.7f * c * c, 0.3f + 1.4f * c * c, 0.7f - 0.7f * c * c, 1.0f)); //GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Specular, new Color4(0.3f + 0.7f * c * c, 0.3f + 1.4f * c * c, 0.7f - 0.7f * c * c, 1.0f)); //GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Emission, new Color4(0.3f + 0.7f * c * c, 0.3f + 1.4f * c * c, 0.7f - 0.7f * c * c, 1.0f));
and added a normal
GL.Begin(BeginMode.Quads); GL.Normal3(0.0f, 0.0f, 1.0f); GL.Vertex3(-1.0f, -1.0f, 1.0f); GL.Vertex3(1.0f, -1.0f, 1.0f); GL.Vertex3(1.0f, 1.0f, 1.0f); GL.Vertex3(-1.0f, 1.0f, 1.0f); GL.End();
and I got the right material. I must think of the material-parameters I commented out but what i really do not understand
until now is the fact that the vector of the normal has a positive z-dir, that means into the screen, so it walks the same
dir as the light vector. If I set z negative the colors look faded.
- StMark's blog
- Login or register to post comments


Comments
Corrections
First I changed the light
the light source is in positive z-Direction, that means it is outside the monitor there where you are sitting and
shining directly into the monitor onto the cubes. There is only ambient light.
Now I can use the normal in the right way, you must do it, otherwise the cubes look fade yellow.
GL.Normal3(0.0f, 0.0f, -1.0f);Next step
With material "Jade" and rotated view
the code
the light
Jade
Now with real data
now I tried to show the real data, but there was a problem with the light, cause
the objects showed no shades. I changed the Light-parameters and it looked
nicer.
So the difference is the ambient light. It is switched off now.