Object-Graphics: How to compute screen XY from model XY [message #75809] |
Sun, 01 May 2011 10:01 |
M. Katz
Messages: 69 Registered: May 2005
|
Member |
|
|
In an object-graphic draw window, I'm trying to figure out the on-
screen pixel location of a given coordinate in the (rotated, scaled,
and translated) model.
Working with IDLgrWindow, it's easy to do the reverse. That is, when
you know a cursor position, [event.x, event.y], you can calculate the
position within the graphics model using
result = oWindow -> PickData(oView, oModel, [event.x,event.y], XYZ)
After this command, it's contained in XYZ.
But what about the other way? Say we have an XYZ value and we want to
calculate the effective cursor position, cursor_xy, or screen
coordinate. This would be the equivalent of an [event.x, event.y].
It seems that there should be a function for this. I'm pretty sure I
can deduce the position from a few sampled points and some vector
math, but should I have to?
Thanks,
M.
|
|
|