Trying to write a raycaster in JavaScript using Canvas.