From: Jonathan B. <jbr...@ea...> - 2005-06-25 01:18:17
|
On Fri, 2005-06-24 at 19:25 -0400, Ilan Volow wrote: > I've never understood why VPython wasn't written purely in python > using PyOpenGL as opposed to using C/C++ to do the OpenGL stuff as it > currently does. The few times I've looked at the VPython code, it > looked like a messy interweaving of python calling C calling python > calling C calling python etc. Actually, its entirely Python->C++. Right now, C++ never calls Python code. > If all the OpenGL stuff were done with > PyOpenGL (and possibly PyGame), I would think that the code would be > cleaner and far more portable. Bruce hit on the first reason - raw speed. The fewer CPU cycles spent rendering, the more can be spent doing physics. The second is that the rendering is performed asynchronously in a separate thread. Python is not really designed for multithreading; only one thread at a time can be executing, even on Hyperthreading-equipped Pentium 4s, multiprocessor, and multicore systems. I have done some experimentation with PyOpenGL to prototype a different OpenGL-using application. I found that the performance was unacceptable for any kind of dynamic scene, such as what most VPython client programs create. -Jonathan |