View Full Version : real size models

01-11-2002, 03:59 AM
I want to display an object(say a line), to the actual dimensions(say 20mm). How to do that in opengl? Actually if I specify a dimension of 20 in opengl it would display a line 20 pixels long but not 20mm. I know ,for instance, in VC++, I can select a mapping mode(MM_LOMETRIC or MM_HIMETRIC)which sets the coordinate units to mm or even 0.1mm, irrespective of the screen resolution. Does any such thing exist in opengl and if not do you have any solution?
Thanks a lot for your precious help.

01-11-2002, 04:33 AM
OpenGL does not deal with units. You have to tweak the coordinates/projection to get the result you want.

For example, if your screen is 40x30 cm, then set an ortho projection to glOrtho(0, 40, 0, 30, -1, 1), and one OpenGL-unit will correspond to 1 cm when projected on the screen. This technique is resolutionindependent.