Mapping the screen in mm

Hello people,
I´m developing an application in Win32 that have to use mm as the measurement unit, I checked about the GetMapMode/SetMapMode functions, but witch is the mode that I have to set, to have one logical unit equivalent to one milimiter ?

Thanks

Kurt

MapMode does not control units in OpenGL.

In fact, OpenGL does not have any set unit that it uses. The units used in OpenGL can represent whatever you want it to be.

j

Thanks J,

So how will be possible to me to perform a zoom factor of 1:1, you know (I mean, the real size of my model in the screen) is it possible ?

Thank you for the moment
Best regards
Kurt

You can use the Windows functions to get the distance in mm between two pixels on the screen.
In OpenGL you can use gluUnproject to get the distance in your object model between two pixels.

With that you could calculate a factor for viewing.

Kilam.

Ok Kilam,
Now it is coming more clear, this is the way that I was thinking, you said :

You can use the Windows functions to get the distance in mm between two pixels on the screen.
In OpenGL you can use gluUnproject to get the distance in your object model between two pixels.
With that you could calculate a factor for viewing.

You can use the Windows functions to get the distance in mm between two pixels on the screen. => how to obtain the distance in mm between two pixels ?

Thank you for the moment
Best regards
Kurt

Come on people, have you never did that ???
Thank you for the moment
Best regarfs
Kurt

You cannot do that because you do not know how the users’s monitor is set. Often there is a variable size black border on the monitor…

You can use the functions:

DPtoLP, LPtoDP, SetMapMode, GetMapMode.

You set your mapping to millimeters and read convert 1 mm to pixels (DPtoLP).

It’s well documented in the MSDN.

BTW: I already said that in this post:

http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/001012.html

aj: If the user has set the monitor settings correct, then windows knows the size of your monitor :wink:

Kilam.

Ok Kilam,

I know that you already said that I have to set the mapping in mm, but how can I do this ?? Witch mode I have to set in the function SetMapMode ???

Thank you for the moment
Best regards
Kurt

Kilam Malik: Forget about it!
On my work we measure people eyes with help of an ordinary monitor and it takes very long time to set the monitor correctly and the power must be on about an hour before the measure starts because the viewing area is a bit smaller when the monitor is cold.

Ok Kilam,
I know that you already said that I have to set the mapping in mm, but how can I do this ?? Witch mode I have to set in the function SetMapMode ???

Thank you for the moment
Best regards
Kurt

Can someone explain me how I set the mapping in mm ???

Thank you
Best regards
Kurt

Hey people,

There is nobody that can show me this stuff ?

Thank you
Kurt

What is mm? :-d

A mm is cm/100 or m/1000! Right?
Why don’t you divide your calculations and convert to mm?

Send some code of what you’re doing, it’d make things clearer and better respond you will get.