Refactoring: added draw_callback functions to draw3d.py, bug fixes.