.

Magic Motion

CAUTION: this script and variations of it can lock up some PCs and have been known to corrupt some PC users' WebTV viewers. I recommend that any pages created with this script be .htaccess for MSNTV IPs only.

THE SCRIPT

NOTES:



Q & A by Flo and Tom

Hi, Tom - I'm still trying to figure out a couple of points. In your directions, you state:

"The last line contains your stopping point and the speed control. In this example, as long as n is less than or equal to 4096 the script repeats itself every 20 milliseconds."

1) Stopping point - does this mean number of micropixels(?) out from the starting point? I've noticed that to make smaller forms, the stopping point needs to be, say 1000, compared to 4000 which would make a much larger form.

2) Also, the number of milliseconds for repeats: the smaller the number, the faster the action goes?

3) Paulie used tangent one time and that's the one that blew the Viewer out, but interestingly webbie just allowed the movement to go off screen at the top and bottom. I did find a tangent plus certain other settings combo that kept Paulie's script within the webbie viewing area. But I forgot to write that down and have had no luck finding it again.

4) I also tried cotangent, but that put everything clear over to the left in a vertical line.

5) I don't remember anything about secant and cosecant at all, lol. I just barely squeaked by in trig, so have almost totally forgotten it all. Thanks again so much for giving us this wonderful script.

Blessings,
Flo

Dear Flo,

N is adding to itself every repeat ... the stopping point is time when n gets out of the specified range.. so if n ever hits 4096 + anything the script stops.

The timeout number is in milliseconds, so the smaller the number the faster the script tries to repeat itself. That timeout is probably accurate on most PCs but webby is very slow...   most scripts run well in the 20 to 50 range ... some will do OK at much smaller values, and after you get to about 500 you can see the individual moves (half seconds).

Sine and cosine vary from -1 to 1 and just make fractions ... so when you use them to multiply by another number, you are essentially starting at zero and going up (or down, depending on sign). The other trig functions can go to infinity ... that is why they are not very suitable for this ...

I have been playing around with some other math formulae, but they are not easy to explain or do a tute on ... just algebraic and geometric progressions, etc .... I may create a page or two with other math.

Blessings,
tom

------------------------------------------------------------------


Flo adds: Since I TL-ed Tom's tute to my own FM, so I wouldn't have to leave my FM in case I had to look up anything in his tute, I'm adding something that he told me since he wrote this tute.

I had made a scope that would not stop running! Here's what Tom wrote when he checked the script as I had changed it:

"You have your timeout set to run as long as n is less than or equal to 100 ... You start n at 44 and are subtracting from it ... it will always be less than 100 ... NO END TO THAT"

There are at least 3 places in the script where I had minus signs. I tried each one in turn, changing the minus signs to plus. But none of them worked, except the r in this line:

if( ++n%30 == 0 ) { r++}


It seems to be the { r++} that controls whether the n is added to or subtracted from! So a word to the wise. :-)