title: Using RayCasting for a 2D game
body: <p>In one of my <a href="https://stackoverflow.com/questions/6799974/opengl-es-ontouchevents-problem-or-a-draw-problem-closed">earlier questions</a> I asked about onTouchEvents in OpenGL.  The idea was to create a simple app that drew a square where you pressed the screen. After a while I came out with an app that did everything the way it should have, but the square didn't redraw, it just vanished from the screen.</p>
  
  <p>I have been told that to solve this I need to send a ray into the 3D environment of OpenGL from my 2D perspective, but for the life of me I can't understand why, because when I read up on raycasting it seemed to be used primarily for lighting effects. What exactly is raycasting?  Why would I need the z-axis at all when all I need to change in the squares position is the x and y axis from which coodinates can be found no matter what depth the touch registers at?</p>