ofLight Very Odd Behaviour


I am working on a 3D graphics project. I should mention that I’m a beginner and that I’ve only tested this on one platform so far, ARM 6.

So I’ve got a large sphere, a camera, and a directional light pointing at the sphere via ofNode.lookAt(). The thing is, I’ve got the light positioned in the back of the sphere and the light is showing on the front of the sphere, as if the light were in front of it. I’ve been doing some testing with lights for a few days and only have just now gotten anything to work. The only way to get what I want currently is to position the light behind the sphere. Putting it in front of the sphere (which is what I want) makes the light shine through the back of the sphere, but not the front. Strange, huh?

Thanks in advance for your help,

  • Daniel Toliaferro

Hi, you need to use setOrientation() when using directionalLight as position of the light source doesn’t matter.
I had the same question in the past. I hope it helps.

Thank you so much @cuinjune, I finally got it working. Now it’s time to learn Quaternions.

I’m glad you figured it out with your project, too!

Best regards,

  • Daniel
1 Like