I'd start from scratch. First off it uses the triangle3d plugin, which is older. The rojo3d plugin is better.
Th 2d one transforms some points with two rotations, then projects them to to the screen. for the 3d you'd need to rotate by the same two rotations. Should be simpler with rojo3d, but i don't have time to create an example at the moment.