how to transform from camera space into world space? How can i get the inverse matrix ?
OpenGL itself does not use the concept of world space, it only maintains the transformation from model space to camera (view) space (in the MODELVIEW matrix).
However, when you write your application you probably have a place in the code where you set up your view and then later apply model transformations to place your objects. So if you just keep a copy of the MODELVIEW after you just set up your view you’ll have the world to camera transformation. Use your favourite vector/matrix library to invert it.