BBC BASIC for Windows
« simple vector roll »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:19pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: simple vector roll  (Read 264 times)
RockOve
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx simple vector roll
« Thread started on: May 30th, 2016, 9:21pm »

This is fun:

Code:
      rem VDU 23,22,width;height;charx,chary,ncols,charset
      vdu 23,22,1125;750;32,32,16,0:rem nikon d3300 size ratio (x=y * 1.5)
      origin 1125,750:rem center poiter moved to center of the screen
      r=100:d=0:rem radius set to 100:degree angle is set to zero
      x1=0:x2=0:x3=0:x4=0:rem cordinates for lines set to zero
      y1=0:y2=0:y3=0:y4=0
      oldd=0:oldr=0:rem variables used to detect any change of the mouse
      :
      :print "Move mouse up/down right/left"
      repeat
        mouse mx,my,mb:rem reads mouse
        r=my:d=mx
        if oldd<>d or oldr<>r then
          gcol 0:rem graphic pen colour
          proc_lines(x1,x2,x3,x4,y1,y2,y3,y4):rem procedure is made at the bottom
        endif
        :
        x1=cos(rad(d+((360/4)*1)))*r
        x2=cos(rad(d+((360/4)*2)))*r
        x3=cos(rad(d+((360/4)*3)))*r
        x4=cos(rad(d+((360/4)*4)))*r
        :
        y1=sin(rad(d+((360/4)*1)))*r
        y2=sin(rad(d+((360/4)*2)))*r
        y3=sin(rad(d+((360/4)*3)))*r
        y4=sin(rad(d+((360/4)*4)))*r
        :
        gcol 15:rem graphic pen colour
        proc_lines(x1,x2,x3,x4,y1,y2,y3,y4)
        oldd=d:rem to remember
        oldr=r
      endif
      until false
      :
      def proc_lines(x1,x2,x3,x4,y1,y2,y3,y4)
      line x1+10,y1+10,x2-10,y2-10
      line x2+10,y2+10,x3-10,y3-10
      line x3+10,y3+10,x4-10,y4-10
      line x4+10,y4+10,x1-10,y1-10
      line 0,0,x1,y1
      endproc


 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls