Rotating ofLight with direction vector

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!

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.

1 Like