From: Axel Kohlmeyer (
Date: Thu Nov 29 2012 - 08:36:17 CST

On Wed, Nov 28, 2012 at 9:21 PM, javacfish <> wrote:
> Hello everyone,
> I want to draw the surface of molecule, so I used the comand "draw trinorm".

why not use the "QuickSurf" representation?

> 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?

getting the normals is not that difficult.
it is a fairly simple problem in spatial geometry.
computing the normal for each triangle is a simple
cross product after normalizing the two vectors that
define the triangle. you could take the average of the
normals from the triangles that share each point.

the key point when scripting them with VMD using trinorm,
is that you make sure that you provide the triangle points
in the correct order and that the normals point into a
consistent direction (usually connected to the "handedness"
of how you specific the points of the triangle).

i'm attaching a VMD script code i wrote quite a while ago
to construct smooth ellipsoids using trinorm. in this case,
the normals are even simpler to construct. you could use this
to debug your norm generation script code (i.e. you feed
it the triangle mesh and compute your normals and compare
to the values from the construction).


> Thanks!
> Sincerely Yours,
> Javacfish

Dr. Axel Kohlmeyer
International Centre for Theoretical Physics, Trieste. Italy.