| Re: Displaying 3-D vector fields [message #32817 is a reply to message #32726] |
Thu, 07 November 2002 09:04   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
This sounds like a job for object graphics.
Someone has to have written a vector object which consists of a few
polylines that make up the body and head in a model. Use would be as simple
as defining the location and magnitude.
Once you have that, something as simple as this would work:
; Your vector locations - XYZ (empty array used as example)
location=FLTARR(100,3)
; Your vector magnitudes - ABC (empty array used as example)
magnitude=FLTARR(100,3)
; Create a model to put all of our vectors in
model = OBJ_NEW('IDLgrModel')
; Fill it up with vector objects
vectors = OBJARR(100)
for n=0, 99 do $
vectors[n] = OBJ_NEW('vector', LOCATION=location[n,*], $
MAGNITUDE=magnitude[n,*])
; Add the array of vectors to our model
model -> Add, vectors
; Display the contents of the model using xobjview
xobjview, model, /BLOCK
; Destroy the objects
OBJ_DESTROY, model
If you want to animate the vectors you'll have to do a little more work but
it would be simple.
The trick is finding the "vector" object. Someone on this list has to have
written something similar. I was giving this a day hoping someone with such
an object would step up... Try searching the usual code archives. I
thought Mark Hadfield had something like this but his webpage isn't up
anymore.
If you want to try and write the vector object yourself left me know and I
can help get you started.
-Rick
"Jim" <jim.blackwell@gsfc.nasa.gov> wrote in message
news:95167173.0211061237.389f387a@posting.google.com...
> Hi all,
>
> After playing with several pieces of code I've found in the archives,
> and not having any luck, I figured I'd ask someone here.
>
> I have X, Y, Z points in space with a,b,c vector component values.
> I'd like to plot these in 3-D space. The data points are in the form
> of a rectangular regularly spaced grid.
>
> Any help would be appreciated
>
> Jim Blackwell
|
|
|
|