How can i do depth sorting

I want to get transparency effect in my scene
which has several complex model.i know that i must do depth sorting from view point.but how can i do it?everyone has relate information?
Thanks a lot.

You must sort the alpha triangles by z-order from the camera and render the triangles from back to front.