Advertisement

light probs

Started by October 30, 2002 03:03 PM
3 comments, last by arrow 22 years, 3 months ago
I've got a small prob. I'm trying to put some lighting stuff into action. I got a globe and a cube. The globe reflects the lighting just as expected but the cube (consisting of separate sides partially transparent partially solid, partially using bitmaps, partially single color) does not. If there is someone who could shed a light it would be nice. Just ask i'll send the three sources. (it might even be a replacement of nehe's lesson 08 if i get the stuff working) the combination of solids and translucents surfaces did cost me quite some headaches so i think people can be helped with it. 3D as never seen before.. that is... it is still not to be seen [edited by - arrow on October 30, 2002 4:45:59 PM]
3D as never seen before.. that is... it is still not to be seen ;-)
hi ppl

if the cube completely one color or totaly dark, is because you must put a normal vector on each face of the vube pointing out that face...

glNormal3f(0.0f, 1.0f, 0.0f);

If you are using the aux, glut or glu sphere, it will appear good becuase those functions calculate the normal it self..

Filami

Techno Grooves
Techno Grooves
Advertisement
Thx,

That solved part of the problem now the cube also lights at the right moment.
I''ll send an exe to Nehe to ask if he can use it as a replacement for his blending tut.

The next problem i''m encountering is not a big proby at this moment but i''ll still ask it

The front and back side ot the cube sides are colored differently but i got the feeling they lightup the same color. I''m using a white light right now and the amb-dif-spec colors are different for both back and front....
anone ... lights plz

3D as never seen before.. that is... it is still not to be seen ;-)
3D as never seen before.. that is... it is still not to be seen ;-)
I is that because you aren't using material colors for the lighting!! (and probrably you won't need that anyway :wink: ). If you want see the color of each face with light you must do this:

glEnable(GL_COLOR_MATERIAL);

or something like that :wink:!!!
But, usualy, it's used textures to map the poligons, and textures don't need that, so, actualy you won't realy need that!!!

Filami

Techno Grooves

[edited by - filami on November 4, 2002 11:04:08 AM]
Techno Grooves
NOP.
that''s not it.. i got that enabled !
only if i make the material emitting in one color i can see the difference. not if i''m make the ambient, diffuse and specular values different.

3D as never seen before.. that is... it is still not to be seen ;-)
3D as never seen before.. that is... it is still not to be seen ;-)

This topic is closed to new replies.

Advertisement