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

Home » Public Forums » archive » Re: "marching ants" rubberband box
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: "marching ants" rubberband box [message #31971] Thu, 05 September 2002 05:16 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ronn kling (ronn@rlkling.com) writes:

> I think you can do this pretty easy in Object Graphics. You would draw the
> box with an IDLgrPolyline object and then just change the stippling pattern
> to mimic motion at each event (cursor motion or timing). The stippling
> pattern is a bitmask that you pass with the linestyle keyword. Look at the
> init method of IDLgrPolyline and the linestyle keyword.

In Photoshop, the ants keep marching while you are drawing the
box and even afterwards, when there is no movement at all.
The only way to simulate that would be timer events, but
there would be a lot of them. And--I don't know--it doesn't
seem like science to me. The fact that there doesn't seem
to be much in the way of CPU time taken up while the ants
do their thing makes me think it must be some kind of build-in
system functionality. It kind of smacks of Microsoft, don't
you think? At least it reminds me of that stupid paper clip
that always annoys the hell out of me when I exit Excel. :-(

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: "marching ants" rubberband box [message #31972 is a reply to message #31971] Thu, 05 September 2002 04:38 Go to previous messageGo to next message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
Hi Ted,

I think you can do this pretty easy in Object Graphics. You would draw the
box with an IDLgrPolyline object and then just change the stippling pattern
to mimic motion at each event (cursor motion or timing). The stippling
pattern is a bitmask that you pass with the linestyle keyword. Look at the
init method of IDLgrPolyline and the linestyle keyword.

In Direct Graphics it would be possible but not very pretty and lots of
code.

-Ronn


--
Ronn Kling
KRS, inc.
email: ronn@rlkling.com
"Application Development with IDL"� programming book updated for IDL5.5!
"Calling C from IDL, Using DLM's to extend your IDL code"!
"Power Graphics with IDL, A Beginner's Guide to Object Graphics", NEW BOOK!
http://www.rlkling.com/
Re: "marching ants" rubberband box [message #31977 is a reply to message #31972] Wed, 04 September 2002 18:16 Go to previous messageGo to next message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
David Fanning <david@dfanning.com> wrote:
> Marshall Perrin (mperrin+news@arkham.berkeley.edu) writes:
>
>> Perhaps one way to implement this in IDL would be via manipulation of the
>> color table - draw one line of two colors, and then alternate what those
>> colors are via the color table rather than redrawing. Of course this then
>> reduces the number of colors for the rest of your image by two.
>
> Oh my gosh, Marshall! You must have one of those 8-bit government
> computers, left over from the 1930's. The rest of us are using
> 24-bit color, I'm sure. :-)

You would not *believe* the number of old Sun boxes with wretched
video cards floating around in the average astronomy department.
Telescopes last for decades - why shouldn't computers do too?
*grumble*

- Marshall
Re: "marching ants" rubberband box [message #31980 is a reply to message #31977] Wed, 04 September 2002 16:24 Go to previous messageGo to next message
Robert Stockwell is currently offline  Robert Stockwell
Messages: 74
Registered: October 2001
Member
Mark Hadfield wrote:
> "David Fanning" <david@dfanning.com> wrote in message
> news:MPG.17e00d99d9f0ed30989993@news.frii.com...
>
>
>> Ted must have more free time than I have, if he
>> wants to do this in IDL. :-)
>
>
> You're not fooling anyone, David. How could you resist such a challenge? The
> little marching ants will gnaw away at your brain and ruin your tennis game
> until you solve it. In fact, I bet you've *already* written a marching-ants
> object and are just trying to raise our interest before you show it to us.
>
> --
> Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
> m.hadfield@niwa.co.nz
> National Institute for Water and Atmospheric Research (NIWA)
>
>

It, of course, should be able to march clockwise, and counterclockwise.
It should have multiple lanes at differing speeds.
And it should also do Escher-like stairways in 3D space.
HOW CAN YOU RESIST!??!


bob
Re: "marching ants" rubberband box [message #31981 is a reply to message #31980] Wed, 04 September 2002 14:27 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield (m.hadfield@niwa.co.nz) writes:

> You're not fooling anyone, David. How could you resist such a challenge? The
> little marching ants will gnaw away at your brain and ruin your tennis game
> until you solve it. In fact, I bet you've *already* written a marching-ants
> object and are just trying to raise our interest before you show it to us.

Alright, I admit it. I thought about it for a few minutes.
But my therapist says I'm doing the right thing getting
out in the fresh air and bashing a ball around. She thinks
in a few years I might actually have a life. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: "marching ants" rubberband box [message #31983 is a reply to message #31981] Wed, 04 September 2002 13:05 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.17e00d99d9f0ed30989993@news.frii.com...

> Ted must have more free time than I have, if he
> wants to do this in IDL. :-)

You're not fooling anyone, David. How could you resist such a challenge? The
little marching ants will gnaw away at your brain and ruin your tennis game
until you solve it. In fact, I bet you've *already* written a marching-ants
object and are just trying to raise our interest before you show it to us.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: "marching ants" rubberband box [message #31986 is a reply to message #31983] Wed, 04 September 2002 12:32 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Marshall Perrin (mperrin+news@arkham.berkeley.edu) writes:

> In Photoshop or the Gimp, selecting an image region will bound it with
> a line of little moving dots, in order to show the edges of the selection
> region. These little moving dots are sometimes referred to as "Marching Ants".

Oh, right.

Ted must have more free time than I have, if he wants
to do this in IDL. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: "marching ants" rubberband box [message #31987 is a reply to message #31986] Wed, 04 September 2002 12:26 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Marshall Perrin (mperrin+news@arkham.berkeley.edu) writes:

> Perhaps one way to implement this in IDL would be via manipulation of the
> color table - draw one line of two colors, and then alternate what those
> colors are via the color table rather than redrawing. Of course this then
> reduces the number of colors for the rest of your image by two.

Oh my gosh, Marshall! You must have one of those 8-bit government
computers, left over from the 1930's. The rest of us are using
24-bit color, I'm sure. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: "marching ants" rubberband box [message #31989 is a reply to message #31987] Wed, 04 September 2002 12:11 Go to previous messageGo to next message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
David Fanning <david@dfanning.com> wrote:
> Ted Graves (graves@helix.mgh.harvard.edu) writes:
>
>> Just wondering if anyone had implemented (or knew of a simple way to
>> implement) a "marching ants" rubberband box.
>
> Oh, oh. Yet one more reason to spend less time playing tennis
> and more time reading the literature. :-(
>
> What the hell is a "marching ants" rubberband box!?

In Photoshop or the Gimp, selecting an image region will bound it with
a line of little moving dots, in order to show the edges of the selection
region. These little moving dots are sometimes referred to as "Marching Ants".

Perhaps one way to implement this in IDL would be via manipulation of the
color table - draw one line of two colors, and then alternate what those
colors are via the color table rather than redrawing. Of course this then
reduces the number of colors for the rest of your image by two.

- Marshall
Re: "marching ants" rubberband box [message #31992 is a reply to message #31989] Wed, 04 September 2002 10:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ted Graves (graves@helix.mgh.harvard.edu) writes:

> Just wondering if anyone had implemented (or knew of a simple way to
> implement) a "marching ants" rubberband box.

Oh, oh. Yet one more reason to spend less time playing tennis
and more time reading the literature. :-(

What the hell is a "marching ants" rubberband box!?

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: "marching ants" rubberband box [message #32042 is a reply to message #31971] Fri, 06 September 2002 12:03 Go to previous message
graves is currently offline  graves
Messages: 7
Registered: September 2001
Junior Member
> In Photoshop, the ants keep marching while you are drawing the
> box and even afterwards, when there is no movement at all.
> The only way to simulate that would be timer events, but
> there would be a lot of them. And--I don't know--it doesn't
> seem like science to me. The fact that there doesn't seem
> to be much in the way of CPU time taken up while the ants
> do their thing makes me think it must be some kind of build-in
> system functionality.

This had occurred to me also, that marching ants would require a lot
of the CPU unless the operation was incorporated into the OS and
didn't require an endless string of timer events.

Thanks for the suggestions. I too was entranced by this devilish
programming challenge. :)






Ted
graves@helix.mgh.harvard.edu
Re: "marching ants" rubberband box [message #32067 is a reply to message #31971] Thu, 05 September 2002 08:52 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
David Fanning wrote:
>
> At least it reminds me of that stupid paper clip
> that always annoys the hell out of me when I exit Excel. :-(

You know, that one can be turned off. Or, like I have, you can change it
to a purring cat. If you choose to do that, you will immediately see
that some department of Microsoft had *way* too much time on their
hands, because the cat sleeps, scratches, meows, sleeps, catches
butterflies and does all sorts of other things. And it behaves
differently in different Office programs.
Oh well. It has a lot more personality than the clip. I even leave it on
the desktop now, while I could not stand the clip.
Cheers,
Pavel
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL5.6?
Next Topic: IDL5.6?

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

Current Time: Wed Oct 08 15:12:01 PDT 2025

Total time taken to generate the page: 0.00770 seconds