function translateToMouse(event) {
  // Get coordinates relative to the canvas.
  var clickLocX = event.offsetX;
  var clickLocY = event.offsetY;
  // Convert to clipspace coordinates.
  x = 2*clickLocX/512.0 - 1;
  y = -(2*clickLocY/512.0 - 1);
}
/* Sets the displacement values to the mouse click location */
Sets the displacement values to the mouse click location
Sets the displacement values to the mouse click location
function translateToMouse(event) {
  var clickLocX = event.offsetX;
  var clickLocY = event.offsetY;
  x = 2*clickLocX/512.0 - 1;
  y = -(2*clickLocY/512.0 - 1);
}
function translateToMouse ( event ) { var clickLocX = event . offsetX ; var clickLocY = event . offsetY ; x = 2 * clickLocX / 512.0 - 1 ; y = - ( 2 * clickLocY / 512.0 - 1 ) ; }
Sets the displacement values to the mouse click location
Sets the displacement values to the mouse click location
// Get coordinates relative to the canvas. // Convert to clipspace coordinates.