Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: real size models

Hybrid View

  1. #1
    Guest

    real size models

    Hello,
    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.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: real size models

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •