Rotating light source in openGL
I've implemented an arcball interface for a 3d objects so i can rotate the object with the mouse. I have a fixed light source. I want the light source to move (rotate) with the object as one unit - meaning that if th开发者_运维知识库e light was above the object, after i rotate the object the light rotates with it and remains above it. I tried to get the MODEL_VIEW_MATRIX (glGetDoublev();) and multiply the light original coordinates by the model view matrix, but it doesn't work well. Any other way to do it? Thanks.
Actualy the MODEL_VIEW_MATRIX effects also the light position, so i only have to define it in the right reference frame.
精彩评论