Page 1 of 1
Some lissajoux figures to play with (iPad only)
Posted: Mon Dec 01, 2014 1:05 pm
by Henko
Code: Select all
graphics ! graphics clear .8,.8,.8
d=56 ! option angle degrees
fill color .8,.8,.8 ! draw color 0,0,0
for i=0 to 2 ! for j=0 to 1
box(d+j*(300+d),20+i*320,300,300,.5,.5,15)
draw color 0,0,0 ! draw size 1 ! shadow on
xo=0 ! yo=0
for a=0 to 720 step 2
x=9*sin((1+2*i)*a) ! y=9*cos((1+1.5*j)*a)
draw_it(xo,yo,x,y) ! xo=x ! yo=y
next a ! shadow off ! refresh
next j ! next i
end
def box(xlu,ylu,width,height,xm,ym,scale)
org_x=xlu+xm*width ! org_y=ylu+(1-ym)*height
xrl=xlu+width ! yrl=ylu+height
refresh off
draw size 4
draw rect xlu-4,ylu-4 to xrl+4,yrl+4
draw size 1 ! draw alpha .2
for x=org_x to xrl step scale ! draw line x,ylu to x,yrl ! next x
for x=org_x to xlu step -scale ! draw line x,ylu to x,yrl ! next x
for y=org_y to yrl step scale ! draw line xlu,y to xrl,y ! next y
for y=org_y to ylu step -scale ! draw line xlu,y to xrl,y ! next y
draw color 0,0,1 ! draw size 2 ! draw alpha 1
draw line xlu,org_y to xrl,org_y
draw line org_x,ylu to org_x,yrl
refresh
end def
def draw_it(xs,ys,xe,ye)
x1=box.org_x+box.scale*xs ! y1=box.org_y-box.scale*ys
x2=box.org_x+box.scale*xe ! y2=box.org_y-box.scale*ye
draw line x1,y1 to x2,y2
end def
Re: Some lissajoux figures to play with (iPad only)
Posted: Mon Dec 01, 2014 2:38 pm
by Mr. Kibernetik
Code: Select all
graphics ! graphics clear .8,.8,.8
d=56 ! option angle degrees
fill color 1,1,1
refresh off
loop:
phaseX+=5
phaseY+=10
for i=0 to 2 ! for j=0 to 1
box(d+j*(300+d),20+i*320,300,300,.5,.5,15)
draw color 1,0,0 ! draw size 1
for a=0 to 720 step 2
x=9*sin((1+2*i)*a+phaseX) ! y=9*cos((1+1.5*j)*a+phaseY)
if a=0 then ! xo=x ! yo=y ! endif
draw_it(xo,yo,x,y) ! xo=x ! yo=y
next a
next j ! next i
refresh
goto loop
def box(xlu,ylu,width,height,xm,ym,scale)
org_x=xlu+xm*width ! org_y=ylu+(1-ym)*height
xrl=xlu+width ! yrl=ylu+height
draw size 4
draw color 0,0,0
fill rect xlu-4,ylu-4 to xrl+4,yrl+4
draw rect xlu-4,ylu-4 to xrl+4,yrl+4
draw size 1 ! draw alpha .2
step=scale
for x=org_x to xrl step step ! draw line x,ylu to x,yrl ! next x
for x=org_x to xlu step -step ! draw line x,ylu to x,yrl ! next x
for y=org_y to yrl step step ! draw line xlu,y to xrl,y ! next y
for y=org_y to ylu step -step ! draw line xlu,y to xrl,y ! next y
draw color 0,0,1 ! draw size 2 ! draw alpha 1
draw line xlu,org_y to xrl,org_y
draw line org_x,ylu to org_x,yrl
end def
def draw_it(xs,ys,xe,ye)
x1=box.org_x+box.scale*xs ! y1=box.org_y-box.scale*ys
x2=box.org_x+box.scale*xe ! y2=box.org_y-box.scale*ye
draw line x1,y1 to x2,y2
end def
Dropbox link:
https://www.dropbox.com/s/ox69j2zyanfbo ... u.txt?dl=0
Re: Some lissajoux figures to play with (iPad only)
Posted: Mon Dec 01, 2014 3:49 pm
by Henko
Nice animation.
You made a powerfull programming language!
Re: Some lissajoux figures to play with (iPad only)
Posted: Mon Dec 01, 2014 3:59 pm
by Mr. Kibernetik
I hope you will like upcoming "pages" functionality...
Re: Some lissajoux figures to play with (iPad only)
Posted: Mon Dec 01, 2014 4:00 pm
by Фант
Отличная работа