2D ray casting and texture mapping