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

Home » Public Forums » archive » Displaying 3-D vector fields
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Displaying 3-D vector fields [message #32863 is a reply to message #32726] Tue, 12 November 2002 12:47 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Jim" <jim.blackwell@gsfc.nasa.gov> wrote

> Hey this is almost what I need. How would one draw more than 1 vector
> at a time in the same window ? 3-D axes ?

By following the steps I laid out in my original post.

Say you want 100 vectors:

; create an object array to hold them

vectors = OBJARR(100)

; create a 100 instances of my vector object

for n=0, 99 do vectors[n] = OBJ_NEW('vector')

; Add our vectors to a model

vecModel = OBJ_NEW('IDLgrModel')
vecModel -> Add, vectors


; Now you have 100 vectors rooted at [0,0,0]
; with a magnitude of [0,0,1]. You probably want them
; to do something now...

; Use the SetProperty method to set each vectors
; magnitude and location. I assume you have 2
; arrays named "mag" and "loc" containing this
; data.

for n=0, 99 do vectors[n] -> Setproperty, MAGNITUDE=mag[n,*], $
LOCATION=loc[n,*]

; Now take a look at what we have.

xobjview, vecModel, /block


; we're done for now, clean up

OBJ_DESTROY, vecModel


If you wanted to animate the vectors you would set up a loop around the call
to the setproperty method where you would loop thru the time dimension of
your array (if the locations were fixed you wouldn't need to change that
property). The only problem with this is that you can't use XOBJVIEW to
view an animation. I would suggest working on some static views making sure
you understand what you are doing (using XOBJVIEW), then go over to David
Fanning's website (www.dfanning.com) and take one of his object graphics
programs and hack the vector animation stuff into it (I suggest FSC_SURFACE?
I think that might come with axes too).

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: use of 'obj_new' within another object definition
Next Topic: IdlGrPolygon - Intersection with planes and lines

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

Current Time: Wed Oct 08 19:14:58 PDT 2025

Total time taken to generate the page: 0.00433 seconds