next up previous contents
Next: Scene Up: Display objects Previous: Displayable   Contents

Subsections


Matrix4

Files: Matrix4.h, Matrix4.C
Derived from: none
Global instance (if any): none
Used in optional component: Part of main VMD code

Description

A 4 by 4 matrix of floats, used primarily for the transformation matrix of Displayable and DisplayDevice objects. Along with general routines to rotate, translate, and scale the matrix, this also contains overloaded operators for = (copy, either a matrix or a scalar), *= (multiply, by either a matrix or a scalar), and += (add a matrix).

There are many functions in this class to simply add or multiply the matrix, to take the inverse of the matrix, or to apply rotations, translations, etc. Most importantly, functions exist to take a 3- or 4-vector, and multiply (transform) it by this matrix.

Constructors

Internal data structures

Method of use

The many functions in this class are not listed here. The most common use of this is to maintain a transformation matrix for transforming 3D vectors from one coordinate space to another, i.e. to rotate, translate, and scale them. Once a 4 by 4 matrix `M' has been set up, then a vector `V' is tranformed and placed in the view vector `VT' as:
M.multpoint3d(V, VT)


next up previous contents
Next: Scene Up: Display objects Previous: Displayable   Contents
vmd@ks.uiuc.edu