PDA

View Full Version : Mapping the screen in mm

KurtCob
12-17-2000, 02:21 PM
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

j
12-17-2000, 04:40 PM
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

KurtCob
12-18-2000, 12:16 AM
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

Kilam Malik
12-18-2000, 01:27 AM
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.

KurtCob
12-18-2000, 01:43 AM
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

KurtCob
12-19-2000, 12:15 AM
Come on people, have you never did that ???
Thank you for the moment
Best regarfs
Kurt

AJ
12-19-2000, 12:19 AM
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..

Kilam Malik
12-19-2000, 12:28 AM
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 ;-)

Kilam.

KurtCob
12-19-2000, 12:46 AM
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

AJ
12-19-2000, 12:49 AM
Kilam Malik: Forget about it! http://www.opengl.org/discussion_boards/ubb/smile.gif
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.

KurtCob
12-19-2000, 08:39 AM
Ok Kilam, http://www.opengl.org/discussion_boards/ubb/confused.gif http://www.opengl.org/discussion_boards/ubb/confused.gif http://www.opengl.org/discussion_boards/ubb/confused.gif
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

KurtCob
12-21-2000, 02:32 AM
Can someone explain me how I set the mapping in mm ?????

Thank you
Best regards
Kurt

KurtCob
12-22-2000, 12:19 AM
Hey people,

There is nobody that can show me this stuff ?

Thank you
Kurt

ms3d
12-23-2000, 02:25 PM
What is mm? :-d

A mm is cm/100 or m/1000! Right? http://www.opengl.org/discussion_boards/ubb/smile.gif
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. http://www.opengl.org/discussion_boards/ubb/smile.gif