WebGL light source and cube map rotate with the viewer

I was trying to implement lighting and environment mapping in WebGL. I got this weird bug that my light source and cube map rotate with my eye position. For example, when I "fly" to the back of my object I can still see the specular reflection and the front of my cube map... This is the code for calculating the reflection vector..

    vec4 N = invertMVM*vNormal;
    R = reflect(eyePos.xyz, N.xyz); 

Answers


I got it.. Using the modleViewMat to transform the reflection vector works.


Need Your Help

Toggle parent class of checkbox on check action using jquery

javascript jquery css checkbox

I am trying to make a form with multiple checkboxes. I want to highlight the checkboxes with their content to indicate to the user of the selection

'Step Into' is suddenly not working in Visual Studio

.net visual-studio-2010 debugging visual-studio-debugging

All of a sudden, I have run into an issue where I cannot step into any code through debugging in Visual Studio. The step over works fine, but it refuses to step into (F11) any of my code. This was