Skip to main content
GameDev.net gamedev.net
🔒 Locked

Question on normals

Started by darkchrono4 Apr 26, 2006 at 1:29 PM 2 replies 750+ views
Original Post
darkchrono4
darkchrono4
I've been messing around with NeHe's tutorials (OGL is much easier then I thought it was) and I've got to some of the later ones that start placing normals on vertices. No matter how I rotate the model around it looks like the light is always shining on the same place. When you are rotating models do you have to adjust the direction of the normal so that light will reflect properly?
Palidine
Palidine
Quote:
Original post by darkchrono4
No matter how I rotate the model around it looks like the light is always shining on the same place.


do you mean the same world relative place or the same object relative place?

i.e. for a character model:

1) when you rotate the model is the light always shining on his right arm

or

2) when you rotate the model is whichever part of the model that's facing the screen always lit?



Did you ever set up the dynamic lighting for openGL? There is no dynamic lighting in openGL by default. you have to flip some switches to activate it. If you didn't do this then you get the #1 option above. Check out the lighting tutorial in the red book:

http://fly.srk.fer.hr/~unreal/theredbook/

-me
darkchrono4
darkchrono4
Whenever I rotate the model the light is shining on his right arm.

I got that red book somewhere, and should dig it out.
MARS_999
MARS_999
You need to call

glLoadIdentity();//position camera with gluLookAt()glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);


every frame before you render your objects

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.