Refactored and improved d3d_draw_ellipsoid.