• ## Outreach

From: Pawel Kedzierski (pawel.kedzierski_at_pwr.wroc.pl)
Date: Thu Nov 29 2012 - 06:34:21 CST

W dniu 28.11.2012 21:21, javacfish pisze:
> Hello everyone,
>
> I want to draw the surface of molecule, so I used the comand "draw
> trinorm".
>
> For example:
>
> draw trinorm { 11.908 -8.784 18.700 } { 11.852 -8.927
> 18.754 } { 11.952 -9.307 18.986 } { -0.50000 0.49196 0.71272 }
> { -0.40246 0.50000 0.76683 } { -0.35202 0.30902 0.88351 }
>
> I know the first three values are the coordinate of points, the second
> three values are the normals. It is very easy to obtain the first
> three values. But the normals seems very hard. Is any formula or
> script to calculate the normals value as above?
It depends what kind of a surface you want to draw. If it will be
composed from flat looking triangles, the normals can be calculated from
plane equation:
http://mathworld.wolfram.com/Plane.html
If the surface is to be composed from (segments of) spheres or
cylinders, the normal can be simply calculated from the difference of
coordinates of two points, e.g. one from the surface and the center.
Nontrivial surfaces may be easier to render (and surely faster) by
preparation of a grid with volumetric data and use of volumetric
rendering capability of VMD.
HTH,
Pawel

>
> Thanks!
>
> Sincerely Yours,
> Javacfish