Additional Tcl Commands (impure OFF)
There are a number of useful commands in the viewer which may not be
put into display lists or pure OFF files. Generally this is because
they do non-graphics operations (e.g. putdlist writes a dlist
as a pure OFF file) or they return values (e.g. getmatrix).
See the pure OFF documentation for more info.
Matrix and Vector Arithmetic
The following commands allow you to do some matrix and vector arithmetic from
within Tcl:
- vdot v1 v2
- returns the dot product of v1 and v2.
- vcross v1 v2
- returns the cross product of v1 and v2.
- vlength v
- returns the length (Euclidean norm) of v.
- vnormalize v
- returns the unit-length vector with the same direction as v.
- mmultiply m1 m2
- returns the product of m1 and m2.
- madd m1 m2
- returns the sum of m1 and m2.
- mtranspose m
- returns the transpose of m1 and m2.
- midentity
- returns the identity matrix
- vtransform v m
- transforms v by the homogeneous matrix m and
returns the resulting vector.
Display List Commands
- putdlist ?fileId? id
- Write a display list out as a pure OFF file. FileId is a
Tcl file identifier as returned by the open command. If
omitted, it defaults to standard output.
Transformation Commands
- getmatrix
- returns the current transformation matrix