Drawing speed

Scott Rossi scott at tactilemedia.com
Fri Feb 22 14:13:01 EST 2002


On Friday, February 22, 2002, at 06:22  AM, Jim Hurley wrote:

> I concede the difficulties in speedily running color vs. black and 
> white, and the improvement in the current release is much appreciated. 
> However there remains a considerable gap between MC/RR and HC. For 
> example, the following script draws concentric boxes of ever decreasing 
> size.
>
> on mouseUp
>   clean
>   put 100 into a
>   put  300 into b
>   put 2 into da
>   choose the line tool
>   put the ticks into startTime
>   repeat 50 --draw boxes of ever decreasing size
>     drag from a,a to b,a
>     drag from b,a to b,b
>     drag from b,b to a,b
>     drag from a,b to a,a
>     add da to a
>     subtract da from b
>   end repeat
>   put the ticks - startTime into field 1
>   choose the browse tool
> end mouseUp
>
> on clean
>   repeat until the number of images = 0
>     delete image 1
>   end repeat
> end clean
>
> This script takes 265 ticks on average in RR and  30 ticks in HC on 
> cards of identical size. (I realize that this can be done more 
> efficiently with the rectangle tool and that a graphic would be faster 
> than an image. My  purpose was to measure the drag speed. ) The 
> discrepancy would be less in Windows.

Since I'm fairly entrenched in graphics work, this post caught my eye.  
One thing you need to keep in mind with MC/REV is that usually, not 
always, but usually there are similar ways to achieve what you've done 
before using alternate methods.  For example, I ran the above script and 
timed a rough average of 111 ticks.  Then instead of choosing the line 
tool, I chose the pencil tool, and drawing time was reduced to 37 
ticks.  Adding a "lock screen" reduced the overall time to 9 ticks -- 
virtually immediate.


> In my case, to properly implement Turtle Graphics, I hunger for a 
> speedy monochromatic drawing  mode.

I seem to recall my experience in Turtle Graphics (around 20 years ago!) 
involving the creation of a list of points that the "Turtle" then 
rendered by dragging from point to point, with pen up and pen down 
instructions.  I would imagine the above mentioned pencil tool will 
achieve what you need with no time penalty.  And also you get the 
benefit of color (back in those days the only screen color was 
phosphorescent green...).

Hope this helps.

Regards,

Scott Rossi
Creative Director, Tactile Media
scott at tactilemedia.com
http://www.tactilemedia.com




More information about the use-livecode mailing list