Re: Keeping rotated plots the same size [message #13965] |
Fri, 18 December 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Borland (davidbor@cyber-dyne.com) writes:
> I am using the plot_3dbox command to draw a cylinder:
> plot_3dbox, image_x,image_y,image_z,/t3d,psym=7,ax = info.ax,az = info.az
> and then I am using widget_sliders to get new values for ax and az.
> What happens when I rotate the cylinder around is that at certain
> values of ax and az the graph is larger than other graphs with different
> ax and az values. Is there a way that I can force the graph to be drawn
> the same size every time?
I'm afraid you are running directly into the problem
the object graphic system was meant to solve: IDL's direct
graphics system is really, technically a 2.5D system.
That is to say, it fakes 3D graphics in a way that was
popular oh, say, in the late 1970's when IDL was first
developed. One of the limitations is that the Z axis
must always remain vertical on the display. (Hence,
no AY keyword for rotation about the Y axis.)
If I am doing something that really requires 3D
rotations, you can bet I am trying hard to figure out
how I can do it with object graphics rather than
with direct graphics. In the case of the Plot_3DBox
program, you are probably looking at a fairly big
job. Not undoable, by any means, but you won't knock
it out in a half hour either. :-)
If this is going to be displayed on a 24-bit color
display, then combining direct graphic programs where
that makes sense (e.g. contour plots) and object
graphics programs where that makes sense (3D rotations,
transparent or opaque surfaces, etc.) is not hard
at all. If you are on an 8-bit display, then you
will probably have considerably more design problems.
(I'm trying to be diplomatic.)
(It is really odd, because I wasn't a real big fan of
24-bit color initially, but I can't imagine running
IDL in anything *but* 24-bit color these days. Once
you sort the color table situation out (and there are
plenty of tools on my web page to help with that),
the advantages so far outnumber the disadvantages that
the decision is a no-brainer.
So, to answer your question directly. No, you can't
force the graph to be drawn the same size every time.
At least not reliably if you are rotating about both
axes. It does sometimes help to use the Position keyword,
but it's not nearly as good as doing it correctly in the
object graphics system.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Note: This follow-up was e-mailed to the cited author.]
|
|
|