3D Plot Manipulation [message #20678] |
Wed, 19 July 2000 00:00  |
Hugh Crowl
Messages: 2 Registered: July 2000
|
Junior Member |
|
|
I'm a bit of an IDL newbie, and have mainly just used it to do the basic
things that it was meant to do (i.e. plotting points and a little 3D
graphing). What I've been working on recently is using the "plot_3dbox"
routine to plot points in three dimensions. What I would like to do
would be to be able to plot stuff in three dimensions and then grab it
with the mouse and rotate it around (like the IDL demo). I suspect that
there is probably a fairly simple widget out there that would take the
data as input and let me do this. In addition, a flythrough the data
would be nice, but it's not as important as 3D rotation.
Thanks in advance!
-Hugh
P.S. We're running IDL 5.1 under SunOS on a Sparc machine.
|
|
|
Re: 3D Plot Manipulation [message #20749 is a reply to message #20678] |
Fri, 21 July 2000 00:00  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
3 consecutive follow-ups to my own post! This must be some kind of record.
This time I want to point out that object graphics scatter lots were
discussed in a thread on this group in March this year, under the heading
"Object graphic 3d Scatterplot". Looking at this thread I see immediately
that I have been re-inventing a pretty fundamental sort of wheel because I
failed to notice that IDLgrPolylines objects--as well as IDLgrPlot
objects--can have symbols attached to them. An IDLgrPolyline, with attached
SYMBOLS and LINESTYLE = 6 (invisible), is the obvious graphics atom to use
for a scatter plot.
Oh well...
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
|
|
|
|
Re: 3D Plot Manipulation [message #20762 is a reply to message #20678] |
Thu, 20 July 2000 00:00  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"Hugh Crowl" <hugh@astro.wesleyan.edu> wrote in message
news:3975F68E.310C29A1@astro.wesleyan.edu...
> surf_track appears to be close to what I want, but it still appears to
only
> be able to handle surfaces. My trouble is that I only have points; not a
> surface. In fact, I would like their to be axes on my graph as I rotate
it.
> Similar to the thunderstorm demo, but with points as opposed to surfaces.
Well, I have a set of fairly general object classes (MGHgrWindow,
MGHgrGraph3D) that can do what you want. if you want to try them, go to
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/, download
MARKS_ROUTINES.tar.gz
or MARKS_ROUTINES.zip and unpack it. Then run mgh_example_scatter (which I
just wrote). All being well you should get a window showing cloud of points
(with Gaussian random number positions) plotted on a graph with a set of
axes. You can rotate, translate or scale the graph.
The only problem with this program is that the points are represented in a
quick, dirty & inefficient way, each point being an IDLgrPlot object with a
single data point and a symbol. Once you get beyond the 300 points or so in
this example, performance becomes very slow. I will think about how to
improve it.
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
|
|
|
Re: 3D Plot Manipulation [message #20769 is a reply to message #20678] |
Wed, 19 July 2000 00:00  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
*Exactly* what you want is probably out there; it is up to you to locate
it or use existing code that is *close* to what you need, to rig up
*exactly* what you need, on your own. Check out David Fanning's site,
you might find something like what you want. I would just notice that
having existing object code that is *almost* what you need, is *exactly*
what I'd dream of, because adding your own things is very easy once you
have all coordinate conversions already established for you.
As a matter of fact, I just tried and surf_track does indeed handle a
random 2D array. What is a "surface", anyway, besides being a number of
coordinates, i.e. a 2D array?
You can easily add axes to the surf_track code and this will be *closer*
to what you want. Insert the following at the line 425 of surf_track.pro:
my_x = obj_new('IDLgrAxis', 0, color=[255, 255, 255], range=[0, xMax], $
XCOORD_CONV=xs, YCOORD_CONV=ys, ZCOORD_CONV=zs)
my_y = obj_new('IDLgrAxis', 1, color=[255, 255, 255], range=[0, yMax], $
XCOORD_CONV=xs, YCOORD_CONV=ys, ZCOORD_CONV=zs)
my_z = obj_new('IDLgrAxis', 2, color=[255, 255, 255], range=[zMin,
zMax], $
XCOORD_CONV=xs, YCOORD_CONV=ys, ZCOORD_CONV=zs)
oGroup->Add, my_x
oGroup->Add, my_y
oGroup->Add, my_z
Then, type on command line:
surf_track, findgen(20, 20)
and you will be able to see and rotate this array with axes. Replace
findgen(20, 20) with your own data, and that should do it.
I would also suggest setting background to white, because it is hard to
see points on the black background.
Try to explore the droplists on surf_track - the one on the left has
"POINT" style and will display points at the nodes of the array.
Cheers,
Pavel
Hugh Crowl wrote:
>
> surf_track appears to be close to what I want, but it still appears to
> only be able to handle surfaces. My trouble is that I only have
> points; not a surface. In fact, I would like their to be axes on my
> graph as I rotate it. Similar to the thunderstorm demo, but with
> points as opposed to surfaces.
>
> Thanks,
> Hugh
|
|
|
Re: 3D Plot Manipulation [message #20774 is a reply to message #20678] |
Wed, 19 July 2000 00:00  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
Hugh,
Manipulating 3D data as you say is not simple and will require
preferebly using object graphics or, at least, some creative widget
programming. However, IDL comes with an object graphics demo code called
"surf_track.pro" (in IDL\Examples\Objects directory) that you can call
with your own data set and rotate the 3D model using the mouse:
surf_track, my_z_data
or, to see built-in data, simply type
surf_track
where my_z_data is your own, (regularly spaced) 2D Z-data set. If you
don't get the result you want immediately, at least surf_track will get
you started. You can then modify the data input, include irregular
spacing handling, etc.
Cheers,
Pavel
Hugh Crowl wrote:
>
> I'm a bit of an IDL newbie, and have mainly just used it to do the basic
> things that it was meant to do (i.e. plotting points and a little 3D
> graphing). What I've been working on recently is using the "plot_3dbox"
> routine to plot points in three dimensions. What I would like to do
> would be to be able to plot stuff in three dimensions and then grab it
> with the mouse and rotate it around (like the IDL demo). I suspect that
> there is probably a fairly simple widget out there that would take the
> data as input and let me do this. In addition, a flythrough the data
> would be nice, but it's not as important as 3D rotation.
>
> Thanks in advance!
>
> -Hugh
|
|
|