Don't touch this. This is my stuff. Look at panda3d.org for source