Re: Computer Graphics Question [message #40416] |
Thu, 05 August 2004 08:15 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
David Fanning <davidf@dfanning.com> writes:
> Craig Markwardt writes:
>
>> 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.
>
> Oh, my goodness, that was easy. And it works great.
> Thanks!
Yay, and computer scientists be damned!
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Computer Graphics Question [message #40419 is a reply to message #40416] |
Thu, 05 August 2004 07:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Craig Markwardt writes:
> 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.
Oh, my goodness, that was easy. And it works great.
Thanks!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Computer Graphics Question [message #40426 is a reply to message #40419] |
Wed, 04 August 2004 21:03  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Craig Markwardt writes:
> 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.
Well, maybe so, but part of my excitement with
this project was finally coming to some uneasy truce
with the computer graphics mathematics involved.
I finally felt like I was starting to understand
something. (Or maybe it was just a bit of indigestion,
I'm not really sure.)
Anyway, I'll give the ridged pixel thing a try. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
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
------------------------------------------------------------ --------------
|
|
|