little cleanup plus ported PerspectiveMatrix3D for further tests