|
Post by tsh73 on Dec 24, 2022 7:12:02 GMT
Have seen it in student C# program I really really doubt he actually wrote this ;(
Most interesting thing is you see rotation, but there is no apparent rotation code
They do have drawPoly in C# And after making square spin and adding first triangle I gave up and did a sub too
Most of the programs is initial points placing. Of course I could put naked numbers but I like having math exposed better (besides, with that I could run it fullscreen and increase R - and it continue working).
'tsh73 Dec 2022 'effect seen in student's program nomainwin global QuitRequested global pX,pY,dX,dY
open "effect" for graphics_nsb_nf as #gr 'open "effect" for graphics_nsb_fs as #gr #gr "trapclose [quit]" #gr "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
N=4+3*4: pX=1: pY=2: dX=3: dY=4 dim p(N,dY) 'points
R=100 d=R*sq2
[again]
'central square to be rotated for i = 0 to 3 a=pi/2*i x=R*cos(a)+cx y=R*sin(a)+cy p(i,pX)=x p(i,pY)=y p(i,dX)=cos(a+pi/2+pi/4) 'btw it is unit vector p(i,dY)=sin(a+pi/2+pi/4) next 'triangles to be moved
'up k=4 p(k+0,pX)=cx p(k+0,pY)=cy-R*2 p(k+1,pX)=cx-R/2 p(k+1,pY)=cy-R*1.5 p(k+2,pX)=cx+R/2 p(k+2,pY)=cy-R*1.5 for i = k to k+3-1 p(i,dX)=0 p(i,dY)=1 next 'down k=k+3 p(k+0,pX)=cx p(k+0,pY)=cy+R*2 p(k+1,pX)=cx-R/2 p(k+1,pY)=cy+R*1.5 p(k+2,pX)=cx+R/2 p(k+2,pY)=cy+R*1.5 for i = k to k+3-1 p(i,dX)=0 p(i,dY)=-1 next 'left k=k+3 p(k+0,pX)=cx-R*2 p(k+0,pY)=cy p(k+1,pX)=cx-R*1.5 p(k+1,pY)=cy-R/2 p(k+2,pX)=cx-R*1.5 p(k+2,pY)=cy+R/2 for i = k to k+3-1 p(i,dX)=1 p(i,dY)=0 next 'right k=k+3 p(k+0,pX)=cx+R*2 p(k+0,pY)=cy p(k+1,pX)=cx+R*1.5 p(k+1,pY)=cy-R/2 p(k+2,pX)=cx+R*1.5 p(k+2,pY)=cy+R/2 for i = k to k+3-1 p(i,dX)=-1 p(i,dY)=0 next
'seeing is believing ' for i = 1 to 4+3 ' #gr "size 4" ' #gr "set ";p(i,pX);" ";p(i,pY) ' #gr "size 1" ' #gr "goto ";p(i,pX)+10*p(i,dX);" ";p(i,pY)+10*p(i,dY) ' next
' wait
for t = 0 to d/2 #gr "cls" for i = 0 to 3 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call pause 16 if QuitRequested then [quit] next
for t = 0 to R #gr "cls" for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call drawPoly 4, 3 call drawPoly 4+3, 3 call drawPoly 4+2*3, 3 call drawPoly 4+3*3, 3 call pause 16 if QuitRequested then [quit] next
goto [again]
#gr "flush"
wait
[tick] wait
[quit] timer 0 close #gr end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
sub drawPoly ind, nPts for ii = 0 to nPts-1 i=ind+ii if ii=0 then #gr "set ";p(i,pX);" ";p(i,pY) else #gr "goto ";p(i,pX);" ";p(i,pY) end if next 'connect to 1st #gr "goto ";p(ind,pX);" ";p(ind,pY)
end sub
|
|
|
Post by marshawn on Dec 24, 2022 10:20:51 GMT
nice, this is the JB logo and also B+
|
|
|
Post by tsh73 on Dec 25, 2022 9:05:05 GMT
Made look more like JB logo
'tsh73 Dec 2022 'effect seen in student's program nomainwin global QuitRequested global pX,pY,dX,dY
open "effect" for graphics_nsb_nf as #gr 'open "effect" for graphics_nsb_fs as #gr #gr "trapclose [quit]" #gr "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
N=4+3*4: pX=1: pY=2: dX=3: dY=4 dim p(N,dY) 'points
R=100 d=R*sq2
[again]
'central square to be rotated for i = 0 to 3 a=pi/2*i x=R*cos(a)+cx y=R*sin(a)+cy p(i,pX)=x p(i,pY)=y p(i,dX)=cos(a+pi/2+pi/4) 'btw it is unit vector p(i,dY)=sin(a+pi/2+pi/4) next 'triangles to be moved
'up k=4 p(k+0,pX)=cx p(k+0,pY)=cy-R*2 p(k+1,pX)=cx-R/2 p(k+1,pY)=cy-R*1.5 p(k+2,pX)=cx+R/2 p(k+2,pY)=cy-R*1.5 for i = k to k+3-1 p(i,dX)=0 p(i,dY)=1 next 'down k=k+3 p(k+0,pX)=cx p(k+0,pY)=cy+R*2 p(k+1,pX)=cx-R/2 p(k+1,pY)=cy+R*1.5 p(k+2,pX)=cx+R/2 p(k+2,pY)=cy+R*1.5 for i = k to k+3-1 p(i,dX)=0 p(i,dY)=-1 next 'left k=k+3 p(k+0,pX)=cx-R*2 p(k+0,pY)=cy p(k+1,pX)=cx-R*1.5 p(k+1,pY)=cy-R/2 p(k+2,pX)=cx-R*1.5 p(k+2,pY)=cy+R/2 for i = k to k+3-1 p(i,dX)=1 p(i,dY)=0 next 'right k=k+3 p(k+0,pX)=cx+R*2 p(k+0,pY)=cy p(k+1,pX)=cx+R*1.5 p(k+1,pY)=cy-R/2 p(k+2,pX)=cx+R*1.5 p(k+2,pY)=cy+R/2 for i = k to k+3-1 p(i,dX)=-1 p(i,dY)=0 next
'seeing is believing ' for i = 1 to 4+3 ' #gr "size 4" ' #gr "set ";p(i,pX);" ";p(i,pY) ' #gr "size 1" ' #gr "goto ";p(i,pX)+10*p(i,dX);" ";p(i,pY)+10*p(i,dY) ' next
' wait
#gr "font Arial_bold ";int(R/2.5);" ";int(R*1.0) #gr "size 3"
logoBlue$=" 0 0 154" 'jb logo blue logoCyan$=" 62 213 162" 'jb logo cyan
#gr "color";logoBlue$
for t = 0 to d/2 #gr "cls" for i = 0 to 3 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call pause 16 if QuitRequested then [quit] next
for t = 0 to R #gr "cls" for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next 'call drawPoly 0, 4 #gr "color";logoBlue$ #gr "backcolor";logoBlue$ #gr "place ";p(0,pX);" ";p(0,pY) #gr "boxfilled ";p(2,pX);" ";p(2,pY) #gr "color white" #gr "place ";cx-R*.3;" ";cy+R*.30 #gr "\B" #gr "color 62 213 162" call drawPoly 4, 3 call drawPoly 4+3, 3 call drawPoly 4+2*3, 3 call drawPoly 4+3*3, 3 call pause 16 if QuitRequested then [quit] next
goto [again]
#gr "flush"
wait
[tick] wait
[quit] timer 0 close #gr end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
sub drawPoly ind, nPts for ii = 0 to nPts-1 i=ind+ii if ii=0 then #gr "set ";p(i,pX);" ";p(i,pY) else #gr "goto ";p(i,pX);" ";p(i,pY) end if next 'connect to 1st #gr "goto ";p(ind,pX);" ";p(ind,pY)
end sub
|
|
|
Post by xxgeek on Dec 26, 2022 16:18:58 GMT
Nice.
If the green triangles get filled in it would be really close to the JB logo. It could be a nice intro to programs written in JB
|
|
|
Post by tsh73 on Dec 26, 2022 19:39:46 GMT
You are welcome :) Just end it with call pause 1000 goto [quit]
so it closes window after. 'tsh73 Dec 2022 'effect seen in student's program 'suggestion by xxgeek: made into animated JB logo nomainwin
UpperLeftX=(DisplayWidth-WindowWidth)/2 UpperLeftY=(DisplayHeight-WindowHeight)/2
global QuitRequested global pX,pY,dX,dY
open "Made with Just BASIC" for graphics_nsb_nf as #gr 'open "effect" for graphics_nsb_fs as #gr #gr "trapclose [quit]" #gr "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
N=4+3*4: pX=1: pY=2: dX=3: dY=4 dim p(N,dY) 'points
R=100 d=R*sq2
[again]
restore for i = 0 to 4+3*4-1 for j = 1 to 4 read t: p(i, j)=t next next
#gr "font Arial_bold ";int(R/2.5);" ";int(R*1.0) #gr "size 3"
logoBlue$=" 0 0 154" 'jb logo blue logoCyan$=" 62 213 162" 'jb logo cyan
#gr "color";logoBlue$
'rotating square for t = 0 to d/2 #gr "cls" for i = 0 to 3 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call pause 16 if QuitRequested then [quit] next
'approaching triangles for t = 0 to R*1.25 #gr "cls" for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next #gr "color 62 213 162" call drawPoly 4, 3 call drawPoly 4+3, 3 call drawPoly 4+2*3, 3 call drawPoly 4+3*3, 3
'call drawPoly 0, 4 #gr "color";logoBlue$ #gr "backcolor";logoBlue$ #gr "place ";p(0,pX);" ";p(0,pY) #gr "boxfilled ";p(2,pX);" ";p(2,pY)
call pause 16 if QuitRequested then [quit] next
'fill triangles (just bu drawing edges) #gr "color 62 213 162" for t = 0 to R*0.25 for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next
for i = 0 to 3 call drawWedge 4+i*3 next next
'rectangle, once again #gr "color";logoBlue$ #gr "backcolor";logoBlue$ #gr "place ";p(0,pX);" ";p(0,pY) #gr "boxfilled ";p(2,pX);" ";p(2,pY) 'letter #gr "color white" #gr "place ";cx-R*.3;" ";cy+R*.30 #gr "\B"
'call pause 1000 'goto [quit] ' goto [again]
#gr "flush"
wait
[quit] timer 0 close #gr end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
sub drawPoly ind, nPts for ii = 0 to nPts-1 i=ind+ii if ii=0 then #gr "set ";p(i,pX);" ";p(i,pY) else #gr "goto ";p(i,pX);" ";p(i,pY) end if next 'connect to 1st #gr "goto ";p(ind,pX);" ";p(ind,pY)
end sub
sub drawWedge ind '2-0-1, no connect #gr "set ";p(ind+2,pX);" ";p(ind+2,pY) #gr "goto ";p(ind,pX);" ";p(ind,pY) #gr "goto ";p(ind+1,pX);" ";p(ind+1,pY) end sub
DATA 256,161,-0.707, 0.707 DATA 156,261,-0.707,-0.707 DATA 56,161, 0.707,-0.707 DATA 156, 61, 0.707, 0.707 DATA 156,-39, 0.000, 1.000 DATA 106, 11, 0.000, 1.000 DATA 206, 11, 0.000, 1.000 DATA 156,361, 0.000,-1.000 DATA 106,311, 0.000,-1.000 DATA 206,311, 0.000,-1.000 DATA -44,161, 1.000, 0.000 DATA 6,111, 1.000, 0.000 DATA 6,211, 1.000, 0.000 DATA 356,161,-1.000, 0.000 DATA 306,111,-1.000, 0.000 DATA 306,211,-1.000, 0.000
|
|
|
Post by xxgeek on Dec 26, 2022 23:01:30 GMT
Getting closer to the JB logo. I figured out how to put a black border around the box, but still needs the little circles at the corners. (I keep messing it up trying) The black border should only be on right side, and bottom. I need to take a course in math to play in your sandbox Also, used a popup window so no frame to close it, use Run>kill Is there anyway to get rid of the flashing? 'tsh73 Dec 2022 'effect seen in student's program 'suggestion by xxgeek: made into animated JB logo nomainwin WindowWidth = 320 : WindowHeight = 320 UpperLeftX=int(DisplayWidth-WindowWidth)/2 UpperLeftY=int(DisplayHeight-WindowHeight)/2 graphicbox #gr.graphicbox, 0, 0, 320, 320 global QuitRequested global pX,pY,dX,dY open "Made with Just BASIC" for window_popup as #gr 'open "Made with Just BASIC" for graphics_nsb_nf as #gr 'open "effect" for graphics_nsb_fs as #gr #gr "trapclose [quit]" #gr.graphicbox "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
N=4+3*4: pX=1: pY=2: dX=3: dY=4 dim p(N,dY) 'points
R=100 d=R*sq2
[again]
restore for i = 0 to 4+3*4-1 for j = 1 to 4 read t: p(i, j)=t next next
#gr.graphicbox "font Arial_bold ";int(R/2.5);" ";int(R*1.0) #gr.graphicbox "size 6"
logoBlue$=" 0 0 154" 'jb logo blue logoCyan$=" 62 213 162" 'jb logo cyan
#gr.graphicbox "color black"';logoBlue$
'rotating square for t = 0 to d/2 #gr.graphicbox "cls" for i = 0 to 3 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call pause 16 if QuitRequested then [quit] next
'approaching triangles for t = 0 to R*1.25 #gr.graphicbox "cls" for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next #gr.graphicbox "color 62 213 162" call drawPoly 4, 3 call drawPoly 4+3, 3 call drawPoly 4+2*3, 3 call drawPoly 4+3*3, 3
'call drawPoly 0, 4 #gr.graphicbox "color";logoBlue$ #gr.graphicbox "backcolor";logoBlue$ #gr.graphicbox "place ";p(0,pX);" ";p(0,pY) #gr.graphicbox "boxfilled ";p(2,pX);" ";p(2,pY)
call pause 16 if QuitRequested then [quit] next
'fill triangles (just bu drawing edges) #gr.graphicbox "color 62 213 162" for t = 0 to R*0.25 for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next
for i = 0 to 3 call drawWedge 4+i*3 next next
'rectangle, once again #gr.graphicbox "color black"';logoBlue$ #gr.graphicbox "backcolor";logoBlue$ #gr.graphicbox "place ";p(0,pX);" ";p(0,pY) #gr.graphicbox "boxfilled ";p(2,pX);" ";p(2,pY) 'letter #gr.graphicbox "color white" #gr.graphicbox "place ";cx-R*.3;" ";cy+R*.30 #gr.graphicbox "\B"
'call pause 1000 'goto [quit] 'goto [again]
#gr.graphicbox "flush"
wait
[quit] timer 0 close #gr.graphicbox end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
sub drawPoly ind, nPts for ii = 0 to nPts-1 i=ind+ii if ii=0 then #gr.graphicbox "set ";p(i,pX);" ";p(i,pY) else #gr.graphicbox "goto ";p(i,pX);" ";p(i,pY) end if next 'connect to 1st #gr.graphicbox "goto ";p(ind,pX);" ";p(ind,pY)
end sub
sub drawWedge ind '2-0-1, no connect #gr.graphicbox "set ";p(ind+2,pX);" ";p(ind+2,pY) #gr.graphicbox "goto ";p(ind,pX);" ";p(ind,pY) #gr.graphicbox "goto ";p(ind+1,pX);" ";p(ind+1,pY) end sub
DATA 256,161,-0.707, 0.707 DATA 156,261,-0.707,-0.707 DATA 56,161, 0.707,-0.707 DATA 156, 61, 0.707, 0.707 DATA 156,-39, 0.000, 1.000 DATA 106, 11, 0.000, 1.000 DATA 206, 11, 0.000, 1.000 DATA 156,361, 0.000,-1.000 DATA 106,311, 0.000,-1.000 DATA 206,311, 0.000,-1.000 DATA -44,161, 1.000, 0.000 DATA 6,111, 1.000, 0.000 DATA 6,211, 1.000, 0.000 DATA 356,161,-1.000, 0.000 DATA 306,111,-1.000, 0.000 DATA 306,211,-1.000, 0.000
|
|
|
Post by marshawn on Dec 27, 2022 2:16:02 GMT
now that's a mod, Carl would be proud
|
|
|
Post by tsh73 on Dec 27, 2022 10:35:58 GMT
xxgeek, what picture you are using as a reference? Could you give a link?
I have no idea what circles are you talking about.
|
|
|
Post by xxgeek on Dec 27, 2022 18:02:41 GMT
There are 3 files in the appdata\bmp dir. jbicon.bmp, jbicon2.bmp and jbrun.bmp
There is not really a border around the box, but some black on 3 of the corners(not really circles, more like a couple of pixels), and a line of black on one of the cyan triangles. If you navigate to the bmp folder and open those files and zoom right in you'll see what I mean.
Playing around changing numbers in your code I came up with quite a few interesting variations. I like these animations. I spent a few hours just playing with numbers. Reminded me of my first computer 'TRS80' with no storage. About all I could do was graphic stuff, and then lose it all when I shut it off. Back then high school math memories (trig and algebra) were fresh in my mind.
40 years later I need a reboot.
|
|
|
Post by xxgeek on Dec 27, 2022 18:06:02 GMT
I was wondering.... If this was recreated using sprites instead, would the flashing be an issue?
|
|
|
Post by tsh73 on Dec 27, 2022 20:09:29 GMT
0. Alt-F4 doing just fine. After drawing you can set up handler om mouse click or key pressed. Also your quit code needs ".graphicbox" removed [quit] timer 0 close #gr.graphicbox end 1. Pictures Icons in BMP folder are too small to see something Actually, icon in JB itself is bigger - 32x32 So best picture I seen is on JB site www.justbasic.com/Scaled 2x in Paint, it gets about same size as this JB drawing (pure coincidence). So There is clearly visible light gray drop shadow under starry octagon. 2. Flicker It flickers because I do CLS on each frame I mainly see flicker on filled rectangle. Now, if I do a BG with filled rectangle on a white field, and use DRAWBMP instead of CLS, rectangle would not flicker. (but cyan triangles will flicker more, at least for me) 3. Could it be made without flicker? If got rid of CLS / clearing BIG portions of window I was lazy (and it was another animation first) so big triangles go under the filled rectangle If one use math to shrink triangle so it never breaks rectangle, we likely could get without CLS (and clear moving triangle by drawing white lines on place it just leaved) But it involves more code and math (or fiddle and a bit of luck) 4. If this was recreated using sprites instead now I think if we got a sprites of triangles - may be even filled ones, and sprite of central square, it likely be flicker-free. And shapes are so simple we could draw there sprites on the run. Really, worth trying.
|
|
|
Post by tsh73 on Dec 27, 2022 20:40:31 GMT
So Jb logo with a drop shadow (but no animation) (and native JB "cyan" is too bright) Thanks to B+ sub drawfilledrectangle 'JB logo by other means nomainwin
UpperLeftX=(DisplayWidth-WindowWidth)/2 UpperLeftY=(DisplayHeight-WindowHeight)/2
global QuitRequested
open "Made with Just BASIC" for graphics_nsb_nf as #gr #gr "trapclose [quit]" #gr "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
R=100 d=R*sq2
#gr "font Arial_bold ";int(R/2.5);" ";int(R*1.0) #gr "size 3"
'drop shadow #gr "color lightgray" call drawfilledrectangle 45, cx+3, cy-d/2+8, R, R call drawfilledrectangle 0, cx-R/2+3, cy-R/2+8, R, R
#gr "color darkgray" call drawfilledrectangle 45, cx+2, cy-d/2+5, R, R call drawfilledrectangle 0, cx-R/2+2, cy-R/2+5, R, R
#gr "color cyan" '45 degrees cyan one? call drawfilledrectangle 45, cx, cy-d/2, R, R #gr "color darkblue" call drawfilledrectangle 0, cx-R/2, cy-R/2, R, R
'letter #gr "color white" #gr "backcolor darkblue" #gr "place ";cx-R*.3;" ";cy+R*.30 #gr "\B"
#gr "flush" wait
[quit] timer 0 close #gr end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
'-----by B+ sub drawfilledrectangle a, x, y, w, h 'tsh fixed #gr "size 2;north;turn 180;turn ";a for i = 1 to h 'draw *part of* bigger and bigger rectangles #gr "place ";x;" ";y;";go ";i;";turn -90;go ";w;";turn 90" next #gr "size 1" end sub
|
|
|
Post by xxgeek on Dec 28, 2022 2:07:22 GMT
Did some more playing with the code, and the numbers. It is by no means perfect, but it looks pretty good. Final picture is done with b+ code, with a little twist.
'tsh73 Dec 2022 'effect seen in student's program 'suggestion by xxgeek: made into animated JB logo nomainwin WindowWidth = 320 : WindowHeight = 320 UpperLeftX=int(DisplayWidth-WindowWidth)/2 UpperLeftY=int(DisplayHeight-WindowHeight)/2 graphicbox #gr.graphicbox, 0, 0, 320, 320 global QuitRequested global pX,pY,dX,dY 'open "Made with Just BASIC" for window_popup as #gr 'open "Made with Just BASIC" for graphics_nsb_nf as #gr open "effect" for window_popup as #gr #gr "trapclose [quit]" #gr.graphicbox "down; fill white; home; posxy cx cy"
sq2=sqr(2) pi=acs(-1)
N=4+3*4: pX=1: pY=2: dX=3: dY=4 dim p(N,dY) 'points
R=100 d=R*sq2
[again]
restore for i = 0 to 4+3*4-1 for j = 1 to 4 read t: p(i, j)=t next next
#gr.graphicbox "font Arial_bold ";int(R/2.5);" ";int(R*1.0) #gr.graphicbox "size 4"
logoBlue$=" 0 0 154" 'jb logo blue logoCyan$=" 62 213 162" 'jb logo cyan
#gr.graphicbox "color black"';logoBlue$
'rotating square for t = 0 to d/2 #gr.graphicbox "down; fill white"'; home; posxy cx cy" for i = 0 to 3 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next call drawPoly 0, 4 call pause t + .015*t if QuitRequested then [quit] next
'approaching triangles for t = 0 to R*1.25 box = box + 1 #gr.graphicbox "down; fill white" for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next
if box < 102 then #gr.graphicbox "color black" call drawPoly 0, 4 #gr.graphicbox "color 62 213 162" call drawPoly 4, 3 call drawPoly 4+3, 3 call drawPoly 4+2*3, 3 call drawPoly 4+3*3, 3 if box > 101 then call drawPoly 0, 4 #gr.graphicbox "backcolor";logoBlue$ #gr.graphicbox "place ";p(0,pX);" ";p(0,pY) #gr.graphicbox "boxfilled ";p(2,pX);" ";p(2,pY) end if call pause t + .015*t if QuitRequested then [quit] next
'fill triangles (just bu drawing edges) for t = 0 to R*0.25 for i = 4+0 to 4+(3*4)-1 p(i,pX)=p(i,pX)+p(i,dX) p(i,pY)=p(i,pY)+p(i,dY) next for i = 0 to 3 call drawWedge 4+i*3 next next
sq2=sqr(2) pi=acs(-1) R=100 d=R*sq2
'drop shadow #gr.graphicbox "color lightgray" call drawfilledrectangle 45, cx+3, cy-d/2+8, R, R call drawfilledrectangle 0, cx-R/2+3, cy-R/2+8, R, R
#gr.graphicbox "color darkgray" call drawfilledrectangle 45, cx+2, cy-d/2+5, R, R call drawfilledrectangle 0, cx-R/2+2, cy-R/2+5, R, R
#gr.graphicbox "color cyan" '45 degrees cyan one? call drawfilledrectangle 45, cx, cy-d/2, R, R #gr.graphicbox "color darkblue" call drawfilledrectangle 0, cx-R/2, cy-R/2, R, R call pause 500 'letter for x = 10 to 100 step 10 #gr.graphicbox "size ";x #gr.graphicbox "color white" '#gr.graphicbox "backcolor darkblue" #gr.graphicbox "place ";cx-R*.3;" ";cy+R*.30 call pause 50 #gr.graphicbox "font Arial_bold ";int(x/2.5);" ";int(x*1.0) #gr.graphicbox "\B" next x 'wait
call pause 3000 goto [again] [quit] timer 0 close #gr end
sub pause mil t=time$("ms") while time$("ms")<t+mil scan wend exit sub [quit] QuitRequested=1 end sub
sub drawPoly ind, nPts for ii = 0 to nPts-1 i=ind+ii if ii=0 then #gr.graphicbox "set ";p(i,pX);" ";p(i,pY) else #gr.graphicbox "goto ";p(i,pX);" ";p(i,pY) end if next 'connect to 1st #gr.graphicbox "goto ";p(ind,pX);" ";p(ind,pY)
end sub
sub drawWedge ind '2-0-1, no connect #gr.graphicbox "set ";p(ind+2,pX);" ";p(ind+2,pY) #gr.graphicbox "goto ";p(ind,pX);" ";p(ind,pY) #gr.graphicbox "goto ";p(ind+1,pX);" ";p(ind+1,pY) end sub
'-----by B+ sub drawfilledrectangle a, x, y, w, h 'tsh fixed #gr.graphicbox "size 2;north;turn 180;turn ";a for i = 1 to h 'draw *part of* bigger and bigger rectangles #gr.graphicbox "place ";x;" ";y;";go ";i;";turn -90;go ";w;";turn 90" next #gr.graphicbox "size 1" end sub
DATA 256,161,-0.707, 0.707 DATA 156,261,-0.707,-0.707 DATA 56,161, 0.707,-0.707 DATA 156, 61, 0.707, 0.707 DATA 156,-39, 0.000, 1.000 DATA 106, 11, 0.000, 1.000 DATA 206, 11, 0.000, 1.000 DATA 156,361, 0.000,-1.000 DATA 106,311, 0.000,-1.000 DATA 206,311, 0.000,-1.000 DATA -44,161, 1.000, 0.000 DATA 6,111, 1.000, 0.000 DATA 6,211, 1.000, 0.000 DATA 356,161,-1.000, 0.000 DATA 306,111,-1.000, 0.000 DATA 306,211,-1.000, 0.000
|
|