View Full Version : Lighting

12-05-2001, 11:37 AM
I am trying to use the light models within visual basic. For a start I can only seem to use light0. All the other lights do not seem to be active. Furthermore, when I rotate the my model, the lighting seems to turn on and off.

The four parameters are I believe to be x,y,z position of the light and the 4th one is to indicate whether it is a direction light. Please enlighten me

many thanks

Rob The Bloke
12-05-2001, 11:49 AM
1. Only Light0 has any values initially, the other lights may seem to be off, but infact they haven't had their parameters set, therefore all colour given out is Black, ie, none

2. In order to place a light in world space, you have to transform it with your glRotate* glTranslate* etc.



// some matrix transforms


glLightfv( GL_LIGHT0, GL_POSITION, pos);

// draw your world here


// swap your buffers