From: Bruce S. <Bru...@nc...> - 2009-12-06 17:09:41
|
Nice! Maybe you would be interested in a related historical reference concerning drawing editors that generate program source code. In 1997 Ruth Chabay realized that intro physics should include computational modeling, given that it was becoming co-equal with theory and experiment and playing a central role in all of science and engineering. In that year, at Carnegie Mellon, she and I had students in intro mechanics model physical systems by writing programs in cT, a programming language I had created in 1985 (see the cT archives on the Documentation page at vpython.org). cT included easy-to-use but not object-oriented 2D graphics. One of the unusual features of cT was that the accompanying text editor was tightly coupled to a drawing editor. If you positioned the cursor in a program and hit F5, you found yourself in a drawing editor that let you create lines (like Basic_0.py), circles, etc., and as you worked in the drawing editor you saw the corresponding program code being inserted into the text editor. You could also select graphics statements in the text editor, press F5, and see and modify the graphics in the graphics editor (with associated changes in the text editor). In 2000 David Scherer created VPython (Chabay and I helped with design and testing), and we abandoned cT because VPython was far superior (3D rather than 2D; object-oriented; based on a standard language, Python). In fall 2000 students in our course at Carnegie Mellon did computational modeling using VPython. It would be neat to have a well coupled drawing editor for VPython, building on Basic_0.py. Of course it is a big challenge to create a good interface for 3D drawing, but there are now some models (e.g. Second Life). Bruce Sherwood Symion wrote: > Hi there, > I'm just answering my own question. > The following program demonstrates 'the problem' and shows how I got > around it. > > Source Code: Basic_0.py > <http://home.iprimus.com.au/knoware/webpage/Basic_0.py> A simple 2D > line drawer. > > This is not a problem with Vpython, but is related to My reliance on the > Default scene object and my attempts to > preserve it. > The solution is to instantiate new display object instead of trying to > reuse the old one. > > Symion |