Re: 3D Vector Field Plot? [message #20235 is a reply to message #20234] |
Wed, 31 May 2000 00:00   |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"John Boccio" <boccio@swarthmore.edu> wrote in message
news:250520001319518743%boccio@swarthmore.edu...
> Hi,
>
> Is there any straightforward way to plot
> directed arrows representing a vector field
> in 3 dimensions?
>
> Anyone have a sample code for direct graphics?
> using IDLgrpolyline?
There is a class called MGHgrBarbPlot on my IDL page (see URLs below). It
uses an IDLgrPolyline to represent a collection of vector barbs with origins
specified by properties DATAX, DATAY & DATAZ and lengths specified by
properties DATAU, DATAV, DATAW. The geometry of the barb origins can be 1D,
2D, 3D, scattered, whatever. One slightly tricky thing that it handles
automatically is to get the aspect ratio "square", at least in normalised
coordinates. (Now that I think of it, it doesn't concern it self with
squareness in the vertical dimension--this would be a simple extension.)
However it doesn't meet your requirements in one significant way: there are
no heads on the arrows. My favoured way to make the array direction
unambiguous is to draw a symbol at each origin.
If you are rolling your own solution in object graphics I have one
suggestion: Use a single IDLgrPolyline for the entire collection of arrows
instead of a separate one for each arrow or part thereof. For large
collections the former is much faster.
URLs:
IDL page:
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/
MGHgrBarbPlot:
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mghgrb arbplot__define.
pro
MGHgrBarbPlot example:
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mgh_ex ample_barb.pro
Collection of all routines:
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/MARKS_ ROUTINES.tar.gz
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/MARKS_ ROUTINES.zip
---
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
|
|
|