transformation matrix for 3D beam updates (untested)