Simple raycast engine from scratch