[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objects in loop



"Richard Adams" <r.j.adams@bath.ac.uk> wrote in message
B69DF7F8.173EE%r.j.adams@bath.ac.uk">news:B69DF7F8.173EE%r.j.adams@bath.ac.uk...
> Hi Murray, I have done similar things to plot hundreds of cells moving
> around in a 3D field. I use the following - convoluted - method. I derived
> this some time ago, so it is perhaps not the most elegant solution..but it
> works on my Macs. I define just once a set of orbs for my models and put
> these into column 1 of an N by 2 object array.  In column 2 I put symbols
> with each object as their shape. That way each object could have its own
> colour and shape. (If I change colour over time I change the orb colour.)
> For each frame I make a polyline plot using these symbols, take an image
and
> paste it into a movie frame. That way you are not moving lots of objects
> about and you create them just once. When all is done, the orbs get
deleted.

That's not quite how I would do it, though maybe I don't understand the
motivation for your approach.

I would describe the cloud of cells (or whatever) as a single IDLgrPolyline
object attached to one or more IDLgrSymbol objects. The polyline stores the
position information for the N cells in its DATA property as a [2,N] or
[3,N] array. It probably has LINESTYLE=6 to suppress the lines between the
vertices, and it stores the shapes in its SYMBOL property. You can use as
many symbols as you want--they are cyclically repeated as necessary. Here is
the relevant IDL documentation

SYMBOL (Get, Set)

Set this keyword to a vector containing one or more instances of the
IDLgrSymbol object class to indicate the plotting symbols to be used at each
vertex of the polyline. If there are more vertices than elements in SYMBOL,
the elements of the SYMBOL vector are cyclically repeated. By default, no
symbols are drawn. To remove symbols from a polyline, set SYMBOL to a
scalar.

Bundling an arbitrary shape into an IDLgrSymbol is straightforward.

You can animate by changing the polyline's vertex data, or by creating a
series of polyline (one per animation frame) all referring to the same
symbol object(s).

---
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