OpenGL lighting problem when rotating the camera

萝らか妹 提交于 2019-12-04 14:21:35

http://www.opengl.org/resources/faq/technical/lights.htm

See #18.050

In short, you need to make sure you're defining your light position in the right reference frame and applying the appropriate transforms each frame to keep it where you want it.

I believe your problem arises from the fact that OpenGL Lights are specified in World Coordinates, but stored internally in Camera Coordinates. This means that once you place a light, whenever you move your camera, your light will move with it.

To fix this, simply reposition your lights whenever you move your camera.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!