Re: Object-Graphics: How to compute screen XY from model XY [message #75808] |
Sun, 01 May 2011 11:27 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
M. Katz writes:
>
> 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?
I'm 99% certain you will have to write this function yourself.
Whether you "should have to" or not, is really way above my
pay grade. Have you been making the proper animal sacrifices? :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|