A numerically efficient and stable algorithm for animating water waves