Re: Computer Graphics Question [message #40428 is a reply to message #40426] |
Wed, 04 August 2004 20:25  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
David Fanning <davidf@dfanning.com> writes:
...
> I'm even able to rotate the text at some arbitrary
> angle ... sorta. There is my problem. Each text line
> has a "box" associated with it, which describes the
> location of the text in a window (normalized coordinates).
> The window can then "select" a text line (to move, for example)
> by asking the text object "Is this point location inside
> your box." (The box also allows me to write my text
> with a background color.)
>
> Well and good as long as the window has just as many
> pixels in the X direction as in the Y direction.
...
> In this case "ratio" is the ratio of !D.Y_Size/!D.X_Size.
> The code works perfectly for 0 and 90 degree rotations.
> It does not work so well for a, say, 45 degree rotation,
> unless the ratio is 1 (the window has the same X and Y size).
David, I think your problem is that you are working in normal
coordinates, but as you appear to be aware, this leads to unequal grid
spacing in the two directions (i.e. non-isotropic).
I do not think that the SCALE keyword is enough for you.
My guess is that the easiest thing to do is to convert to pixel
coordinates, do your rotation, and then convert back to normal
coordinates. The pixel coordinate system is isotropic, so you are
set.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|