|
From: Dirk R. <dre...@ia...> - 2006-02-25 05:29:13
|
Hi Bjoern,
bjo...@uf... wrote:
> Dear all,
>
> How do use a different material and different colors on the front and
> back side of the polygons?
>
> I have a simple quadrangle with colors (and secondary colors -> where
> are these used?") set. I
>
> would like to render the front and back side of this polygon
> differently, e.g. with a general material
>
> on the front (not using the colors on the vertices) and using the
> colors from the vertices on the back
>
> side: I tried the code below. When I change values for the front side
> (for example setting
>
> ColorMaterial to GL_DIFFUSE) this always seems to affect both sides.
>
> ...
Generally I would expect your code to work, but I vaguely remember some
badly defined situations involving color material, I need to check the
spec to see if I remember what it was.
> -----------------------------------------------------------------------------------------------------
>
> I also tried to use a SimpleMaterial for the front. Then I added a
> MaterialChunk where I
>
> set another SimpleMaterial as BackMaterial. I could have different
> material on the back
>
> and front but found it difficult to predict the result .......
>
> What is the right way to do what I want ? What is the secondary Color
> for and how do
>
> I make use of it?
>
OpenGL has a lighting mode that uses the secondary color after
texturing, to allows material highlights on textures. For your problem
they won't help you.
Yours
Dirk
|