Re: Adaptation of surf_track for viewing earthquakes in 3 dimensions [message #31435] |
Thu, 11 July 2002 21:34  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"Thomas Wright" <twright@usgs.gov> wrote in message
news:aee1db91.0207110002.b4d9e7a@posting.google.com...
> ...Animations are run using a driver program that calls surf_track
> in a loop that converts the 3-d object view to a 2-d view, then
> loads an mpeg file run by xinteranimate. Several questions have come
> up in the course of this development.
That's not the most elegant way to animate a 3D system, because all 3D
information is lost when the animation is prepared.
I have played around with animations in IDL. There are all sorts of
ways you can do it. I have investigated 3 of them:
- Save each frame as an image and animate the image sequence (as you
describe)
- Store a sequence of atoms (or models or whatever) representing the
changing part of the graphics tree in a container, Animate by
adding, displaying and removing each object in this sequence.
- Store a sequence of command objects, each describing which atom
(or model ...) in the view is to be modified, the method to be
called on that object, and the keyword data required by that
method. Animate by applying each command in turn.
All are useful in different situations, but the third is the one I use
the most. I created a class called MGH_Command specifically for
storing the commands. You might want to look at my library at
ftp://ftp.niwa.cri.nz/incoming/m.hadfield/MGH_MOTLEY.tar.gz
See mgh_example_animate.
> I had expected to be able to freely configure symbol size, symbol
> shape and color to represent different earthquake parameters such as
> magnitude, depth, time intervals or other user-defined
> classification parameters. But none of the IDLgr routines allows
> this. IDLgrpolyline allows symbol manipulation, but only one
> color. IDLgrpolygon accepts a color matrix using vertex_colors, but
> has no call to symbol. Idlgrplot has both symbol and color control,
> but the z parameter, if used, is set to a constant.
The normal way to display a cloud of symbols is to attach them to an
IDLgrPolyline with LINESTYLE = 6 (invisible). You can have more than
one symbol attached to the IDLgrPolyline, in which case the symbols
are used in turn and cyclically repeated if necessary. And you can
give each symbol a different COLOR property. So in principle you can
display as many different symbols as you want. In practice you may
find redrawing gets slow if you have too many different symbol
objects, so it may require some ingenuity to limit the number. As I
recall, if a symbol's colour is a single byte value then it represents
an index into the color lookup table of the parent's PALETTE
object. You can use this fact to store up to 256 different symbol
colours relatively economically. This was discussed in a thread in
March 2000 entitled "Object graphic 3d Scatterplot".
I won't comment on the feasibility of modifying SURF_TRACK
except to say that I've usually found it simpler in the long run to
write my own code rather than adapt code from the IDL library.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|