Does anyone know how I can achieve a 3d rotation with a 2D image?

Does anyone know how I can achieve an effect like this?

Create 2D billboarded sprites that are rotated in 3d space around the y axis.