VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Mar 03 2014 - 10:22:46 CST
- Next message: Dawid das: "Writing new coordinates to file."
- Previous message: John Stone: "Re: Issues using VMD 1.91. with CUDA on Mac OSX 10.9.1"
- In reply to: Lee-Ping Wang: "Drawing circles and tooltips."
- Next in thread: Lee-Ping Wang: "Re: Drawing circles and tooltips."
- Reply: Lee-Ping Wang: "Re: Drawing circles and tooltips."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
I have a few short questions for you that will help me answer
your questions in the best way possible.
1) For the "circles" you want to draw, are they merely meant for
interactive display, as line-drawn circles, or would you prefer
something that would also show up in a ray traced rendering of
the scene (e.g. Tachyon, POV-Ray, etc), in which case you'd really
want a torus and not a circle.
2) What polyhedra are you really after? Are there specific shapes you want?
Modern OpenGL has moved away from rendering methods that are based on
immediate mode commands, and even display lists. Small polyhedra fall into
a gray area between what could be done efficiently with OpenGL 1.x and
the minimum geometry size that can be drawn with reasonable performance on
modern hardware oriented towards OpenGL 3.x and 4.x. If you can tell me
more about what you're doing, I can give a useful answer as to whether it
is worth building in primitives for this in VMD or not.
3) There isn't a built-in way to do tooltips, and this would be problematic
for large structures with millions of atoms, but there is a way that a
user-written script can get callbacks as the mouse moves, and building
upon this, one could do a tooltip style interface if the number of potential
targets was moderate, and not all atoms.. :-)
I will have to dig up the code for this, as it has been some time since
I last looked at it, but there should be a way to do what you want using
the VMD mouse event callbacks and a little post-processing of the
returned coordinates, etc.
Cheers,
John Stone
vmd_at_ks.uiuc.edu
On Fri, Feb 28, 2014 at 06:58:35AM -0800, Lee-Ping Wang wrote:
> Hi there,
>
>
>
> I'm interested in doing a few things with VMD and I'm wondering if it's
> possible.
>
>
>
> 1) Drawing circles. I have the following TCL snippet for drawing a
> circle but it's kind of slow. I could also use VMD spheres with
> angle-modulated transparency, but in this case I would prefer for it to
> simply be a circle.
>
>
>
> proc vmd_draw_circle {mol cnt ex ey {radius 1.0} {res 36} {thickness 5}} {
>
> # Draw a circle, given the center, two unit vectors, radius,
> resolution and thickness.
>
> set pi 3.1415926535897931
>
> for {set i 0} {$i < $res} {incr i} {
>
> set q0 [expr 2 * $pi * ($i-0.1) / $res]
>
> set r0 [vecadd [vecadd $cnt [vecscale $ex [expr $radius *
> cos($q0)]]] [vecscale $ey [expr $radius * sin($q0)]]]
>
> set q1 [expr 2 * $pi * ($i+1.1) / $res]
>
> set r1 [vecadd [vecadd $cnt [vecscale $ex [expr $radius *
> cos($q1)]]] [vecscale $ey [expr $radius * sin($q1)]]]
>
> graphics $mol line $r0 $r1 width $thickness
>
> }
>
> }
>
>
>
> 2) Drawing small polyhedra. My method is to create atoms at the
> positions of the vertices and use the "Polyhedra" representation.
> However, VMD complains that there are too many bonds and does not draw all
> of the polyhedral faces.
>
>
>
> 3) Tooltips. Is it possible to pop up an image if I mouse-over an
> atom or graphics object?
>
>
>
> Thanks,
>
>
>
> - Lee-Ping Wang
-- NIH Center for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349 http://www.ks.uiuc.edu/Research/vmd/
- Next message: Dawid das: "Writing new coordinates to file."
- Previous message: John Stone: "Re: Issues using VMD 1.91. with CUDA on Mac OSX 10.9.1"
- In reply to: Lee-Ping Wang: "Drawing circles and tooltips."
- Next in thread: Lee-Ping Wang: "Re: Drawing circles and tooltips."
- Reply: Lee-Ping Wang: "Re: Drawing circles and tooltips."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]