From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Jul 16 2004 - 10:09:06 CDT

Hi,

On Fri, Jul 16, 2004 at 04:07:36PM +0200, Olaf Lenz wrote:
[ ellipsoids... ]
> It may happen that ellipsoid are only the start of the story. I for my part
> would also like to see cylinders, for example, and one could also think of
> other objects.

VMD can already draw:
  points, lines, triangles, cylinders, spheres, and 3-D text

With the existing point, line, and triangle primitives one can basically
render anything they want, it is just a matter of getting a decent
tessellation of the surface you wish to draw, and drawing it with high
performance. VMD actually contains several methods for drawing tessellated
surfaces with high performance, basically several different ways of specifying
the triangle mesh in degrees of increasing efficiency and complication.

One could actually draw ellipsoids with the existing version of VMD,
but I mention adding it as a special primitive because it could share much
of its code with the existing sphere rendering routines, and would be much
higher performance than if drawn using the general purpose routines.

> Maybe it is possible to provide a plugin interface that enables the user to
> create the own representation? I could also think of a generic "user"
> representation where a user could provide a Tcl "graphics" command to
> actually draw the object.

This is on the todo list, but unlike the existing plugins for other purposes,
representation plugins would want access to many of VMD's internal data
structures, which complicates things significantly, since any change to
the internal data structures breaks compatbility with a plugin that was
compiled against older versions. So, we either have to provide plugin API
routines that translate from the internal data structures to a neutral
representation that plugins can work with, or we'd have to be willing
to rewrite or at least recompile all representation plugins whenever
a change is made to any of the data structures they'd read. I haven't
yet made up my mind what the cleanest way of doing this is, it is complex
enough that making the wrong choice would do more harm than good, so in
the mean time I've put off this feature until some of the less complicated
items on the todo list are completed.

> I'd also be willing to contribute to this, but I don't know if this is
> possible.

There's an class of "import graphics" plugins which could be (ab)used to
do this now, if you have static structures that don't move. Take a look
at graspplugin.C for an example of how they work. They create geometry
directly, but once loaded, you cannot change the geometry so it is nowhere
near as flexible as a representation plugin would be. But, it might be
better than nothing in the short-term if you want to easily load your
geometry data into VMD.

  John

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078