comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 3D Plot Manipulation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
3D Plot Manipulation [message #20678] Wed, 19 July 2000 00:00 Go to next message
Hugh Crowl is currently offline  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 Go to previous message
Mark Hadfield is currently offline  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 #20750 is a reply to message #20678] Fri, 21 July 2000 00:00 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Mark Hadfield" <m.hadfield@niwa.cri.nz> wrote in message
news:964048678.156607@clam-ext...
> Re my previous post, I have tried a few different methods of representing
a
> 3-D cloud of points in object graphics--see the attached .pro file. Having
> one graphics atom per data point is terribly slow if the number of points
> exceeds a few hundred. The best method I have been able to come up with so
> far is to use a single text object with one string per data point. With
this
> method it's feasible to deal with a few thousand points.

I have now written an object specifically for this purpose. It's called an
MGHgrScatterPlot and it represents each data point as a polyline in the x-y
plane, with all the polylines bundled into a single IDLgrPolyline object.
Now I can plot over 10,000 data points reasonably quickly. See

http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mghgrs catterplot__defi
ne.pro
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mgh_ex ample_scatter.pr
o

---
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 Go to previous message
Mark Hadfield is currently offline  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 Go to previous message
promashkin is currently offline  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 Go to previous message
promashkin is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Funny math?
Next Topic: Re: TrueType font caution

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:46:25 PDT 2025

Total time taken to generate the page: 0.00584 seconds