Changing Dimmer Light Position Using Keyboard
I was wondering if there''s a way to change the position of a dimmer light using the keyboard (for example, one "press" of the 6 on the numpad would move it a coordinate to the right). From what I''ve seen in the tutorials (particularly the one on lighting), the lighting''s position is set only once during the window''s initialization. Can it be changed in the DrawGLScene function, or is there another way around this? All replies are welcome.
zippo
yes you just have to call the method to set the lighting again with the new light position
i.e.
lightpos={x,y,z,1.0f};
glLightfv(GL_LIGHT1, GL_POSITION,lightPos);
assuming you are changeing Light1 in the scene
Check out my shadows page
and send me some feedback
i.e.
lightpos={x,y,z,1.0f};
glLightfv(GL_LIGHT1, GL_POSITION,lightPos);
assuming you are changeing Light1 in the scene
Check out my shadows page
and send me some feedback
Check out my shadows page and send me some feedback
Thanks for the info! I wasn''t sure if I could just call it again like that. Good to know. I figured I could, but was at the office at the time, so couldn''t really try it out. I figured since I''m here, I might as well ask real quick. I tried it out and it works like a gem. I took a quick glance at your shadows reference/tutorial/program and found it to be very enlightening. I''m sure I''ll be going back to it for closer examination. Thanks again!
zippo
zippo
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement