Tcl Matrix 3d

Back to

It provides high-speed 3d rotation and vector manipulation through a new command vexpr.

vexpr uses reverse-polish notation. Commands and arguments are pushed into a stack, and the topmost element in the stack is returned as the result. This was done for partly ease of implementation, and partly because no order of operations rightly exists for matrix operations.

The code and documentation is available for download here.

The latest version is 0.2, while I try to test the snot out of it, it should be considered alpha. I've actually managed to tweak the standard tcl extension to build this thing. Once you download that tarball, run

cd src/vexpr
make install

On my gentoo boxen I have to tell the system where tcl lives:

cd src/vexpr
./configure --prefix=/usr
make install

The parser operates using reverse-polish notation (like an HP calculator.) Each argument is pushed onto the stack, and when a command is detected, they are popped off the stack. The result of the command is pushed onto the stack in their place.

Why? Well mostly for ease of implementation. Partly because there is no PEMDAS equivilent order of operation for Matrices and vectors.

I've broken the manual up into a few chunks:

  • A basic explaination of vexpr syntax with example.
  • A reference manual of vexpr opcodes
  • A set of example scripts performing common operations with vexpr.

    Questions, comments, tips? Email Sean Woods(