The "projection operator" method is a variation of the normal-vector method for simulating optical diffraction from biperiodic gratings. A projection operator defined by the normal vector is interpolated over the grating volume rather than interpolating the vector itself. This approach circumvents difficulties associated with sign reversals and discontinuities encountered with the normal-vector method, and it facilitates implementation for general grating geometries. The method is readily extensible to anisotropic and bianisotropic materials. Several numerical examples of the new method are presented, including comparisons to previously published test cases.