BBC BASIC for Windows
Programming >> Graphics and Games >> VDU graphics + thickness + 3D sphere TOOL+MOUSE
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1457398591

VDU graphics + thickness + 3D sphere TOOL+MOUSE
Post by michael on Mar 7th, 2016, 11:56pm

This took some digging
1) REM statements cant be placed after a VDU statement
2) VDU graphics screen statements apparently must be separate from the VDU line thickenss statement

FINALLY the conversion is accurate and functions much like the original 3D sphere tool I made on another platform

Issues seem to be fixed with borders.
HOLD LEFT MOUSE BUTTON DOWN AND DRAG MOUSE ACROSS SCREEN QUICKLY

The speed of the mouse draws with the level of image complexity does make me happy I am using BBC BASIC
Code:
     
 REM SET MODE TO 8 USING VDU
      VDU 22,8
      REM SET LINE THICKNESS TO 3
      VDU 23,23,3|
      OFF
      GCOL 1
      PROC_sphere(200,700,50,100,200,100,3)
      PROC_sphere(800,500,250,200,150,200,1)
      PROC_sphere(600,500,300,150,150,200,1)
      PROC_sphere(500,300,300,200,200,200,1)
      (mou)
      MOUSE x,y,b
      IF b=4 THEN PROC_sphere(x,y,50,100,200,100,3)
      GOTO (mou)
      END
      DEF PROC_sphere(H,V,SIZE,R,G,B,DI)
      r%=R
      g%=G
      b%=B
      size%=SIZE
      dimmer%=DI
      FOR x%=0 TO size%
        c%=50
        r%=r%-dimmer%
        g%=g%-dimmer%
        b%=b%-dimmer%
        IF r% <2 THEN r%=2
        IF g% <2 THEN g%=2
        IF b%<2 THEN b%=2
        IF r%<50 AND g%<50 AND b%<50 THEN GOTO (jump)
        COLOUR 1,r%,g%,b%
        CIRCLE H,V,x%
        (jump)
      NEXT x%
      ENDPROC