Rotating ofLight with direction vector


#1

Hi everyone,

I’m working on a simulation application that shows the effects of lighting up led-strips and triangles. I got 2 coordinates for every led: the place of the led (x,y,z) and the direction of the light(u,v,w). Now I want to place an ofLight infront of the leds to see the effects. I can’t seem to find/understand any of the math that I can use to point the light in the right direction. Is there anyone that can help me with this?

Thanks!


#2

ofLight extends ofNode so you should be looking at the documentation here. There are methods to set the position and lookAtDirection so those should be useful.