Loading 3d-turtle.fs +7 −7 Original line number Diff line number Diff line Loading @@ -169,8 +169,8 @@ IS dummy-canvas [THEN] 1e f>fs Constant #1. pi f2* FConstant 2pi 2pi 1/f FConstant 1/2pi pi f2* FConstant tau tau 1/f FConstant 1/tau \ : .matrix ( addr -- ) \ &12 sfloats bounds Loading Loading @@ -488,7 +488,7 @@ class; : phi>xy ( f -- f1 f2 ) rot-mode sf@ f* fsincos 1e f- 1e f+ ; : degrees ( f -- ) 1/2pi f* rot-mode ! ; : degrees ( f -- ) 1/tau f* rot-mode ! ; : left ( f -- ) phi>xy trans-2,0 trans-3,0 do-turn ; : down ( f -- ) phi>xy trans-1,0 trans-3,0 do-turn ; Loading Loading @@ -695,10 +695,10 @@ class; : >texture ( addr f -- ) IS do-texture y-text sf! 0e z-off sf! ; : xy-texture ['] do-xy-text 1e >texture ; : zphi-texture ['] do-zphi-text 1/2pi >texture ; : zphi2-texture ['] do-zphi2-text 1/2pi >texture ; : zphi-texture ['] do-zphi-text 1/tau >texture ; : zphi2-texture ['] do-zphi2-text 1/tau >texture ; : zp-texture ['] do-zp-text 1e >texture ; : rphi-texture ['] do-rphi-text 1/2pi >texture ; : rphi-texture ['] do-rphi-text 1/tau >texture ; : no-texture ['] noop 1e >texture ; \ texture loading (ppm) 31jan99py Loading Loading @@ -1117,7 +1117,7 @@ class; LOOP f2* forward drop end-path ; : cylinder ( r1 r2 d n -- ) { f: r1 f: r2 f: d } 2pi dup fm/ set-dphi tau dup fm/ set-dphi dup start-path r1 .01e f* 0e dup segment \ ugly workaround r1 0e dup segment Loading dragon-shoot.fs +3 −3 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ Create .sky .3e sf, .6e sf, .8e sf, 1e sf, IF .text ELSE drop THEN ; Variable tail-time : time' ( -- 0..2pi ) : time' ( -- 0..tau ) tail-time @ [ #24 #60 #30 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : time-pos ( -- 0..2pi ) : time-pos ( -- 0..tau ) tail-time @ [ #24 #60 #5 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : tail-wag ( n -- f ) Loading @@ -46,7 +46,7 @@ Variable tail-time ro set-r ri .1e set-rp dphi sf@ phi sf@ f+ phi sf! 1 DO ri set-r LOOP 2pi phi sf! ro set-r tau phi sf! ro set-r 0e phi sf! } ; F : tail-compensate ( n -- f ) 0e 0 DO I 2+ tail-wag f+ [ 1.1e 1/f ] Fliteral f* LOOP Loading dragon.fs +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ Create .sky .3e sf, .6e sf, .8e sf, 1e sf, IF .text ELSE drop THEN ; Variable tail-time : time' ( -- 0..2pi ) : time' ( -- 0..tau ) tail-time @ [ #24 #60 #30 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : tail-wag ( n -- f ) Loading @@ -43,7 +43,7 @@ Variable tail-time ro set-r ri .1e set-rp dphi sf@ phi sf@ f+ phi sf! 1 DO ri set-r LOOP 2pi phi sf! ro set-r tau phi sf! ro set-r 0e phi sf! } ; F : tail-compensate ( n -- f ) 0e 0 DO I 2+ tail-wag f+ [ 1.1e 1/f ] Fliteral f* LOOP Loading sincos.fs +3 −3 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ base @ hex base ! $6487F Constant 2pi 2pi 1 + 4 / Constant pi/2 2pi 3 + 8 / Constant pi/4 $6487F Constant tau tau 1 + 4 / Constant pi/2 tau 3 + 8 / Constant pi/4 $B505 Constant sqrt.5 | : (sini ( n -- sin[n] ) 2* sintab + w@ ; Loading tree.fs +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ Create .green .5e sf, .8e sf, .4e sf, 1e sf, dup .03e fm* dup .1e fm* 6 segment over 1 ?DO #1000 random rd-val < IF 2pi I I' fm*/ { f: di | IF tau I I' fm*/ { f: di | >turtle di roll-left pi 5 fm/ right di roll-right 2dup 1- (tree Loading Loading
3d-turtle.fs +7 −7 Original line number Diff line number Diff line Loading @@ -169,8 +169,8 @@ IS dummy-canvas [THEN] 1e f>fs Constant #1. pi f2* FConstant 2pi 2pi 1/f FConstant 1/2pi pi f2* FConstant tau tau 1/f FConstant 1/tau \ : .matrix ( addr -- ) \ &12 sfloats bounds Loading Loading @@ -488,7 +488,7 @@ class; : phi>xy ( f -- f1 f2 ) rot-mode sf@ f* fsincos 1e f- 1e f+ ; : degrees ( f -- ) 1/2pi f* rot-mode ! ; : degrees ( f -- ) 1/tau f* rot-mode ! ; : left ( f -- ) phi>xy trans-2,0 trans-3,0 do-turn ; : down ( f -- ) phi>xy trans-1,0 trans-3,0 do-turn ; Loading Loading @@ -695,10 +695,10 @@ class; : >texture ( addr f -- ) IS do-texture y-text sf! 0e z-off sf! ; : xy-texture ['] do-xy-text 1e >texture ; : zphi-texture ['] do-zphi-text 1/2pi >texture ; : zphi2-texture ['] do-zphi2-text 1/2pi >texture ; : zphi-texture ['] do-zphi-text 1/tau >texture ; : zphi2-texture ['] do-zphi2-text 1/tau >texture ; : zp-texture ['] do-zp-text 1e >texture ; : rphi-texture ['] do-rphi-text 1/2pi >texture ; : rphi-texture ['] do-rphi-text 1/tau >texture ; : no-texture ['] noop 1e >texture ; \ texture loading (ppm) 31jan99py Loading Loading @@ -1117,7 +1117,7 @@ class; LOOP f2* forward drop end-path ; : cylinder ( r1 r2 d n -- ) { f: r1 f: r2 f: d } 2pi dup fm/ set-dphi tau dup fm/ set-dphi dup start-path r1 .01e f* 0e dup segment \ ugly workaround r1 0e dup segment Loading
dragon-shoot.fs +3 −3 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ Create .sky .3e sf, .6e sf, .8e sf, 1e sf, IF .text ELSE drop THEN ; Variable tail-time : time' ( -- 0..2pi ) : time' ( -- 0..tau ) tail-time @ [ #24 #60 #30 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : time-pos ( -- 0..2pi ) : time-pos ( -- 0..tau ) tail-time @ [ #24 #60 #5 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : tail-wag ( n -- f ) Loading @@ -46,7 +46,7 @@ Variable tail-time ro set-r ri .1e set-rp dphi sf@ phi sf@ f+ phi sf! 1 DO ri set-r LOOP 2pi phi sf! ro set-r tau phi sf! ro set-r 0e phi sf! } ; F : tail-compensate ( n -- f ) 0e 0 DO I 2+ tail-wag f+ [ 1.1e 1/f ] Fliteral f* LOOP Loading
dragon.fs +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ Create .sky .3e sf, .6e sf, .8e sf, 1e sf, IF .text ELSE drop THEN ; Variable tail-time : time' ( -- 0..2pi ) : time' ( -- 0..tau ) tail-time @ [ #24 #60 #30 * * ] Literal um* drop 0 d>f [ !$2'-8 pi f* ] FLiteral f* ; : tail-wag ( n -- f ) Loading @@ -43,7 +43,7 @@ Variable tail-time ro set-r ri .1e set-rp dphi sf@ phi sf@ f+ phi sf! 1 DO ri set-r LOOP 2pi phi sf! ro set-r tau phi sf! ro set-r 0e phi sf! } ; F : tail-compensate ( n -- f ) 0e 0 DO I 2+ tail-wag f+ [ 1.1e 1/f ] Fliteral f* LOOP Loading
sincos.fs +3 −3 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ base @ hex base ! $6487F Constant 2pi 2pi 1 + 4 / Constant pi/2 2pi 3 + 8 / Constant pi/4 $6487F Constant tau tau 1 + 4 / Constant pi/2 tau 3 + 8 / Constant pi/4 $B505 Constant sqrt.5 | : (sini ( n -- sin[n] ) 2* sintab + w@ ; Loading
tree.fs +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ Create .green .5e sf, .8e sf, .4e sf, 1e sf, dup .03e fm* dup .1e fm* 6 segment over 1 ?DO #1000 random rd-val < IF 2pi I I' fm*/ { f: di | IF tau I I' fm*/ { f: di | >turtle di roll-left pi 5 fm/ right di roll-right 2dup 1- (tree Loading