home *** CD-ROM | disk | FTP | other *** search
/ Blender Volume 3 #3 / BLENDER.iso / pc / files / judy.dxr / 00177.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  1.7 KB  |  55 lines

  1. global iteration, ax, bx, cx, ay, by, cy, x1, x2, x3, x4, y1, y2, y3, y4, w, h
  2.  
  3. on Bezanimate channel
  4.   set iteration to iteration + 1
  5.   if iteration = 51 then
  6.     set iteration to 0
  7.     updatelines()
  8.   end if
  9.   set t1 to float(iteration / 50.0)
  10.   set t2 to float(t1 * t1)
  11.   set t3 to float(t2 * t1)
  12.   set the locH of sprite channel to integer((ax * t3) + (bx * t2) + (cx * t1) + x1)
  13.   set the locV of sprite channel to integer((ay * t3) + (by * t2) + (cy * t1) + y1)
  14. end
  15.  
  16. on BezInit channel
  17.   set w to the width of sprite channel
  18.   set h to the width of sprite channel
  19.   set x to random(640)
  20.   set Y to random(480)
  21.   set x1 to min(max((w / 2) + 20, x), 620 - (w / 2))
  22.   set y1 to min(max((h / 2) + 20, Y), 460 - (w / 2))
  23.   set x2 to x1 + (random(50) * getAt([1, -1], random(2)))
  24.   set y2 to y1 + (random(50) * getAt([1, -1], random(2)))
  25.   set x to random(640)
  26.   set Y to random(480)
  27.   set x4 to min(max((w / 2) + 20, x), 620 - (w / 2))
  28.   set y4 to min(max((h / 2) + 20, Y), 460 - (w / 2))
  29.   set x3 to x1 + (random(50) * getAt([1, -1], random(2)))
  30.   set y3 to y1 + (random(50) * getAt([1, -1], random(2)))
  31.   set cx to 3 * (x2 - x1)
  32.   set cy to 3 * (y2 - y1)
  33.   set bx to (3 * (x3 - x2)) - cx
  34.   set by to (3 * (y3 - y2)) - cy
  35.   set ax to x4 - x1 - cx - bx
  36.   set ay to y4 - y1 - cy - by
  37. end
  38.  
  39. on updatelines
  40.   set x1 to x4
  41.   set y1 to y4
  42.   set x2 to x3
  43.   set y2 to y3
  44.   set x4 to min(max((w / 2) + 20, random(640)), 620 - (w / 2))
  45.   set y4 to min(max((h / 2) + 20, random(480)), 460 - (w / 2))
  46.   set x3 to x4 + (random(50) * getAt([1, -1], random(2)))
  47.   set y3 to y4 + (random(50) * getAt([1, -1], random(2)))
  48.   set cx to 3 * (x2 - x1)
  49.   set cy to 3 * (y2 - y1)
  50.   set bx to (3 * (x3 - x2)) - cx
  51.   set by to (3 * (y3 - y2)) - cy
  52.   set ax to x4 - x1 - cx - bx
  53.   set ay to y4 - y1 - cy - by
  54. end
  55.