Go for it, I've written a depth buffer algorithm before too, most of it was assembly, but the algorithm would be the same.