getting mapscale

Hello

I am writting a simple CAD viewer with OpenGL
It draw the graphics objects in a “perspective” scene.

How do I calculate the map scale of the view ?
Where can I read information?

Thanks in avance