I have problems drawing a cube with glutSolidCube and assigning a
certain material defined with glMaterialfv to it. Everytime I draw a
cube it renders white at the output.
Anybody knows how to correct this?
JuanLievano ha escrito:
let us know of the results you get after changing the light settings.
cheers
Harsh
Harsh ha escrito:
Sounds to me like you have bad normals. All
surface normals should have length 1 or
do "glEnable(GL_NORMALIZE);"
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again. They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful. But it happens
every day. I cannot recall the last time something like
that happened in politics or religion.
- Carl Sagan, 1987 CSICOP keynote address
Another thing is that I made the glEnable(GL_NORMALIZE), and the
renderized image is worst than if I don't use it. Why?
fungus ha escrito:
The normals are transformed by the modelview
matrix, glScale() will change their length.
If you're using glScale then you *MUST* enable
GL_NORMALIZE or lighting won't work.
In the old days, GL_NORMALIZE was expensive
so it was good to be able to turn it off.
These days it's free so you can leave it
on all the time.
> I don't know how but If I reduce
> the solid cube in a very small factor, the surface starts to show
> itself white... instead, if I define the cube with very small side
> length, and use a huge multiplyer in the scale function, then it shows
> ok. The thing is I don't understand why.
>
glScale() changes your normals.
> Another thing is that I made the glEnable(GL_NORMALIZE), and the
> renderized image is worst than if I don't use it. Why?
>
You have a bug somewhere...