fiddling with matrices again. not tested yet.

part of the infrastructure for animation