I am not sure what you mean. In the demos, use the left/right cursor keys to
pan the spotlight and the up/down cursor keys to tilt the spotlight. The W/S
keys move it forwards and backwards. It can be positioned anywhere pointing in
any direction.

The purpose of these demos is to present the shaders to create spotlights,
flashlights and projective texturing with/without shadow and normal mapping
for general purposes. For a specific use, you will need to supply your own
movement/placement code.

For instance, if you want to make a flashlight that follows your camera, then
each frame you need to do something like this;

vec_set(temp_vec, vector(10,-10,-10)); // create a vector
vec_rotate (temp_vec, camera.pan); // rotate the vector to the cameras pan
vec_add (temp_vec, camera.x); // position the vector at the camera
vec_set(flashlight_mdl.x, temp_vec); // position your flashlight model
vec_set(flashlight_mdl.pan, camera.pan);

Then send the position of the flashlight model to your shader.


Not two, not one.