ANN: Rolling graphics

Jim Hurley jhurley at infostations.com
Fri May 13 00:21:54 EDT 2005


>
>Message: 4
>Date: Thu, 12 May 2005 11:01:08 -0400
>From: Thomas McGrath III <3mcgrath at adelphia.net>
>Subject: Re: ANN: Rolling graphics
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <42f0948937c1f934bff82988ffbfd73a at adelphia.net>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>Jim,
>
>I had a lot of fun skiing. There used to be this game with tanks that
>you send over to your opponent different bombs etc. Then they get to
>bomb you. Just plain time wasting fun. I love it.
>
>If Rev includes bezier that would be great. Could you not then include
>a library for the calculations???
>JAT
>
>Thanks for sharing this.
>
>Tom

Tom,

I guess it depends on how it is implemented. What is needed is the 
location of the four (or more) handles for the bezier line. If the 
points are known (r1, r2, r3, and r4) then the calculation is simple:


   put the r1 of me into pt1
   put the r2 of me into pt2
   put the r3 of me into pt3
   put the r4 of me into pt4
   repeat with i = 0 to 100
     put i/100 into t
     put 1-t into s
     repeat with j = 1 to 2
       put (s*s*s*item j of pt1 + 3*s*s*t*item j of pt2 + \
           3*s*t*t*item j of pt3 + t*t*t*item j of pt4) into item j of thePt
     end repeat
     put thePt & return after tCustomPoints
     put round(item 1 of thePt),round(item 2 of thePt) & cr after tPoints
   end repeat
   set the customPoints of grc "BezierLine" of the owner of me to tCustomPoints
   set the points of grc "BezierLine" of the owner of me to tPoints

Where "me" is the bezier line. This will generate 100 points for the 
line. The calculated coordinates are in tCustomPoints and the points 
need to draw the graphic line are int tPoints.

Jim



More information about the use-livecode mailing list