Learning Ego 3D Representation as Ray Tracing