From: B.D Allen (B.D.Allen_at_newcastle.ac.uk)
Date: Sun Sep 03 2006 - 20:38:38 CDT

Hi Neela,
  The reason the matrices are 4x4 and not 3x3 is that you need to use 4x4
homogeneous coordinates for things like combined rotation/translation or
proper perspective projection.
  If you only need rotations, just add a 1 to the x,y,z coordinate vector.
i.e.
      3D Homogeneous
     x,y,z --> x,y,z,1

Then fill the 4x4 matrix with your rotation as follows:

| 3x3 |0|
| rot |0|
|matrix|0|
|------
|0 0 0 1|

  To add a translation, then rotation/scale (e.g. arbitrary change of
coordinate system), put a translation vector into the rightmost column,
leaving the 4,4 entry as 1.
  Have a look around the web for 'homogeneous coordinates'. I'm sure that
you'll find a better explanation.

Cheers

Ben

> Hi,
> I am writing a routine that will align a (C=O) of my simulated system
> along
> an axis, and then align th (C-N) along another axis. While I have figured
> out what I need to do, I do not understand why the Matrix Routines in vmd
> yield 4X4 matrices:
> http://www.ks.uiuc.edu/Research/vmd/current/ug/node176.html
>
> At the end, we would really like to mutliply our {x y z} vectors with the
> transformation matrix, right? So the transformation should be a 3X3
> matrix.
> Could somebody point out what I am missing here?
>
> Thanks,
> Neela
>

Ben Allen
Molecular Photonics Laboratory
School of Natural Sciences
Bedson Building
University Of Newcastle Upon Tyne
Newcastle Upon Tyne
NE1 7RU

http://www.ncl.ac.uk/mpl
+44 (0)191 2227111