Просмотр исходного кода

"align" iMouse with the webgl coords

i.e. origin is in the left, lower corner.  (this is how shadertoy does
it, and we better be a bit compatible if we're using the same variable
names and stuff.  and it's also better.)
Lucas Stadler лет назад: 10
Родитель
Сommit
d71c9a2763
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      glsl/raymarching.js

+ 1 - 1
glsl/raymarching.js

207
    });
207
    });
208
    
208
    
209
    tt.canvas.addEventListener("mousemove", function(ev) {
209
    tt.canvas.addEventListener("mousemove", function(ev) {
210
      gl.uniform3f(iMouse, ev.clientX, ev.clientY, 0.0);
210
      gl.uniform3f(iMouse, ev.clientX, canvas.clientHeight - ev.clientY, 0.0);
211
      requestAnimationFrame(tt.render);
211
      requestAnimationFrame(tt.render);
212
    });
212
    });
213
    
213