Maybe you could have created the pyramid in 3D and rendered it ahead of time to SVG, so you could end up with a perfect perspective projection.