! Original IFS/Julia by ! ........................................................................ ! : David Doff, Geology Department, Trinity College, Dublin 2, Ireland : ! :------------------------------.---------------------------------------: ! : Tel: +3531 702 1419 : e-mail: ddoff@tcd.ie : ! : Fax: +3531 671 1199 : ddoff@alf2.tcd.ie : ! :..............................:.......................................: ! idea of +/- a by ddoff@vax1.tcd.ie ! "City of Angels" Morphing and trails added by Steve Witham ! (visiting southern California) Dec. 24, 1998 let trailsMode = 1 let colorMode = 1 let flipFlopMode = 0 ! Reverse color at every change of course. B&W only. let scatterMode = 0 ! Revisit pixels in random order. call setMacPallette set color "white" ask color white set color "black" ask color black if trailsMode = 1 then let minTrailColor = 1 ask max color maxTrailColor let trailColor = black let flockColor = white let nFlock = 2000 else let trailColor = white let flockColor = black let colorMode = 0 let flipFlopMode = 0 let nFlock = 800 end if if colorMode = 1 then let flipFlopMode = 0 let longTime = 30000 ask pixels xpix, ypix let veryLongTime = 600 * 800 * 5 dim flockX(1), flockY(1) mat redim flockX(nFlock), flockY(nFlock) let longCounter = veryLongTime set WINDOW -2/3, 2/3, -.5, .5 let a1 = .21 let a2 = -.21 let b1 = .27 let b2 = .27 let a1inc = 0 let a2inc = 0 let b1inc = 0 let b2inc = 0 let counter = -longTime randomize ! clear for i = 1 to nFlock let flockX(i) = 0 let flockY(i) = 0 next i let i = 1 do if counter = 0 then ! Set targets for morphed a1, a2, b1, b2 let a1t = rnd - .5 let a1inc = ( a1t - a1 ) / longTime let a2t = rnd - .5 let a2inc = ( a2t - a2 ) / longTime let b1t = rnd - .5 let b1inc = ( b1t - b1 ) / longTime let b2t = rnd - .5 let b2inc = ( b2t - b2 ) / longTime let counter = longTime end if let a1 = a1 + a1inc let a2 = a2 + a2inc let b1 = b1 + b1inc let b2 = b2 + b2inc if counter > 0 then let counter = counter - 1 if counter = 0 then ! Made it all the way through... if colorMode = 1 then let trailColor = minTrailColor + int( rnd * (maxTrailColor-minTrailColor+1) ) end if let counter = longTime ! Keep going with these 'inc's as long as you can. end if else let counter = counter + 1 end if IF RND < .5 THEN let a = a1 let b = b1 ELSE let a = a2 let b = b2 end if let x = flockX(i) let y = flockY(i) set color trailColor Plot points: x, y let newx = x * x - y * y + a let newy = 2 * x * y + b if abs(newx) > 4 or abs(newy) > 4 then let newx = 0 let newy = 0 let counter = 0 ! Try some different constants. if flipFlopMode = 1 then let temp = flockColor let flockColor = trailColor let trailColor = temp end if else ! set color mod( x*x*10000, 256 ) set color flockColor Plot points: newx, newy end if let flockX(i) = newx let flockY(i) = newy if scatterMode = 1 then let i = int( rnd * nFlock ) + 1 else let i = mod( i, nFlock ) + 1 end if let longCounter = longCounter - 1 if longCounter <= 0 and flipFlopMode = 0 and colorMode = 0 then let temp = flockColor let flockColor = trailColor let trailColor = temp let longCounter = veryLongTime end if loop sub setMacPallette for r = 0 to 5 for g = 0 to 5 for b = 0 to 5 if r=0 and g=0 and b=0 then set color mix(255) r/5, g/5, b/5 else set color mix(36*(5-r)+6*(5-g)+(5-b)) r/5, g/5, b/5 end if next b next g next r end sub end