From: Bruce S. <ba...@an...> - 2000-11-13 17:59:42
|
--On Monday, November 13, 2000, 6:21 PM +0100 Rochus Schmid <roc...@ch...> wrote: > Dear Bruce, > > I use Python (+NumPy + own C-extensions) for a while now in a self > developed quantum chemistry code. This code is based on some (Wave)fcts > discretized on even spaced cartesian grids in real space. Basically for > debugging and getting a clue of what is going on I wrote a simple > "grid-viewer" using PyOpenGL (and always hated to fiddle with the > Togl.so and stuff). > In this context I always wanted to write a simple molecular viewer and > orbital analysis tool in python (thought about PyOpenGL maybe together > with wxPython etc. etc.). > > There are others who have done something like that (PyMol from Warren > Delano or PVM from Michael Sanner at Scripps) but they are very focused > on visualizing protein structers and large organic molecules (with fancy > display stiles etc etc.) > However I want it much more simple. > Balls and Spheres (maybe some labels and arrows) should do it as long as > I can click and select with my mouse. > It seems to me that VPython is just what I was looking for. > I will have to get my hands dirty and see how far I get. > > From looking at the pdf-docs and the demos VPython seems quite perfect > for me (especially the seperate thread for the viewer is great). > One question: > from the demos it seems that rotating the scene means rotating the > lighting with it. how could I trackball rotate an object without > rotating the light ... well, I guess that means not moving the camera > around but really rotating the object (especiall a collection of > objects?) No, when you trackball rotate, you rotate the camera, not the scene, so the lighting stays where it was. (That is, rotate by 180 degrees and you see the shadowed side of the scene.) At the moment there is no control over the positioning of the lighting. As you say, if you want the objects to rotate separately from the lighting, you can rotate the objects. In fact, you could put all of the individual objects into a Visual "frame" and just rotate that one composite object. In the demo "stonehenge.py" is an example of continuously changing the camera position and angle to allow free roaming through the scene. > > and (forgive me ;-) one more: > I just dreamt about a posiblility to simultaneously "show" the real > space grid along with the molecule. that probably means to first get an > isosurface with a "marching cube" algorithm or something like that and > to render that. Did you and the other developers of VPython ever think > about something like that? It looks like you focused a lot on > visualizing physics with VPython and that might be a more common taks. > The alternative is to have some kind of "mesh"-object (From playing with > convex it seems to me that this is not really what I need). Dave Scherer has from time to time expressed interest in implementing some kind of grid or height field. One hopes that he or someone else will do this eventually. > I read a quastion in the archives about the accessability of "raw" > OpenGL calls inside VPython. > I do not know if one could generate a GL_LIST using PYOpenGL and hand > this over to VPython (Or is that stupid?) I don't know enough to comment on this. > If the "mesh"-object would exist (say an array for surface points in the > right order and some normal vectors or so) one could calculate this > array seperate from VPython in NumPy or alternatively in some other > C/C++-module. > But I have to say, that I realized that I would probably not be able to > extand VPYthons Objects cause I am probably simply too stupid for C++ > and looking at the CXX stuff just killed me :-) > ooops, that is tough. > So simple C extensions and NumPy and a couple of PyOpenGL calls is ok > .... but the convex.cpp .... too much for me. > > I am not quite sure if I could clarify what I wanted to say. But thanks > for your patience reading up to this point. > Even if the "grid-visualization" does not work VPYthon as awesome. > Thanks. Glad you like it! > > Greetings from sunny Munich, I very much enjoyed visiting Munich for a week in 1960, but I haven't been back since. > > > Rochus > > > -- > > Dr. Rochus Schmid > Technische Universität München > Lehrstuhl f. Anorganische Chemie > Lichtenbergstrasse 4, 85747 Garching > > Tel. ++49 89 2891 3174 > Fax. ++49 89 2891 3473 > Email roc...@ch... > > |