View Full Version : Mapping the screen in mm
KurtCob
12-17-2000, 01: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
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-17-2000, 11:16 PM
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, 12: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, 12: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-18-2000, 11:15 PM
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..
Kilam Malik
12-18-2000, 11:28 PM
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-18-2000, 11:46 PM
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! 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, 07: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, 01:32 AM
Can someone explain me how I set the mapping in mm ?????
Thank you
Best regards
Kurt
KurtCob
12-21-2000, 11:19 PM
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? 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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.