Just be aware that the Up vector is hard coded in the example above... If you want it to be Really flexible, you can replace vector4f(0,1,0,0) with your own Up direction in your engine.