diff --git "a/15_\347\202\271\345\205\211\346\272\220/code/\347\202\271\345\205\211\346\272\220.html" "b/15_\347\202\271\345\205\211\346\272\220/code/\347\202\271\345\205\211\346\272\220.html" index c8304f427dfa3630b4cf11880b42a0593cb535e5..7ea61e722e55e85ed7dae26678e50228dd53659f 100644 --- "a/15_\347\202\271\345\205\211\346\272\220/code/\347\202\271\345\205\211\346\272\220.html" +++ "b/15_\347\202\271\345\205\211\346\272\220/code/\347\202\271\345\205\211\346\272\220.html" @@ -29,7 +29,7 @@ gl_Position = u_formMatrix * a_position; vec3 normal = normalize(vec3(u_NormalMatrix * a_Normal)); - vec3 lightDirection = normalize( vec3(gl_Position.xyz)-u_PointLightPosition ); + vec3 lightDirection = normalize( u_PointLightPosition-vec3(gl_Position.xyz) ); float nDotL = max(dot(lightDirection, normal), 0.0); vec3 diffuse = u_DiffuseLight * vec3(1.0,0,1.0)* nDotL; vec3 ambient = u_AmbientLight * vec3(1.0,0,1.0);