locked
small basic graphic and animations and more (7) RRS feed

All replies

  • sunspinning: QQS326
    Monday, July 24, 2017 4:47 PM
  • sunspinning: QQS326

    Little modified: QQS326-0.

    Screen shot of a program Sunspinning (modified version)


    Nonki Takahashi

    Friday, July 28, 2017 5:39 AM
    Moderator
  • collection of turtle pyramids: SFM765

    Tuesday, August 1, 2017 6:31 PM
  • domino wheel: JCP978

    Thursday, August 3, 2017 7:39 PM
  • spiral dominoes: VQC005

      • use arrow keys to pan view
      • mswheel to zoom
      • rmb+wheel to rotate view

    Friday, August 4, 2017 11:12 AM
  • the new paint3d w10 app has many nice 3d models. but they cannot be used in sb ld3d without some modifications.

    here's some example: JVM131

    u can convert this model in following way:

    1. save desired model as 3mf format
    2. goto makeprintable.com
    3. upload 3mf file
    4. execute conversion on makeprintable
    5. download stl converted file and reference to it in sb app
    6. and voila!


    • Edited by Tryhest Monday, August 7, 2017 1:03 PM
    Monday, August 7, 2017 12:57 PM
  • 100m sprint emulator: KRT332

    to run: press fast repeatly m+spacebar at same time

    Monday, August 7, 2017 9:31 PM
  • fish update: JVM131-0

    they rotate and spin around now

    Tuesday, August 8, 2017 6:06 AM
  • new update: JVM131-1

    fish2 in lemniscata swimming path around 2 objects

    Tuesday, August 8, 2017 6:31 AM
  • now both fish swim in opposite lemnypath: JVM131-2

    Tuesday, August 8, 2017 6:42 AM
  • creates 3d relief form 3d height bitmaps: MSB133

    source bmp: (to be downloaded and saved locally and referenced in sb, on line 27 )

    Monday, August 14, 2017 10:26 AM
  • some other example/result:

    Monday, August 14, 2017 10:28 AM
  • doublesided 3d relief: TXJ416

    Monday, August 14, 2017 10:43 AM
  • Fishes spinning (JVM131-2)  with Cassini.stl (Transformerversion)

    Final Images 2017/15/09

    Monday, August 14, 2017 6:35 PM
  • sine wave text anim: JHX691
    Wednesday, August 16, 2017 8:40 PM
  • gamepad usage demo: PFK323

    press btn 5 on gamepad to start drawing, 6 to stop

    move with leftside or rightside gamepad buttons

    Monday, August 21, 2017 4:33 PM
  • solar ecclipse anim:CLV135

    Monday, August 21, 2017 10:20 PM
  • ... and everything under the sun is in tune
    when the sun was eclipsed by the moooooon.

    Monday, August 21, 2017 10:47 PM
    Answerer
  • PXK994 waves demo

    Thursday, August 24, 2017 7:24 AM
  • Hi Team,

    I Made A Simple Graphic Game,

    https://gallery.technet.microsoft.com/Small-Basic-Simple-Battle-45736438

    Thanks,

    Friday, August 25, 2017 9:55 AM
  • PXK994 waves demo

    Tryhest, would you like to become an Answerer in this forum? 

    Thanks!


    Ed Price, Azure Development Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Saturday, September 2, 2017 12:24 AM
    Owner
  • Hi Team,

    I Made A Program

    Lines Of Different width

    PROGRAM ID = SGF951

    Thanks,

    Saturday, September 2, 2017 3:43 PM
  • nice! once we had school notebooks with similar covers:sgf951-0

    Saturday, September 2, 2017 9:37 PM
  • also with some sine effects: sgf951-1

    Saturday, September 2, 2017 9:48 PM
  • also with some sine effects: sgf951-1

    Hi Team,

    Its A Good Update

    Thanks,

    Sunday, September 3, 2017 7:23 AM
  • found some xamarin sample:

    not much info just this spanish example

    Tuesday, September 5, 2017 2:50 PM
  • a bit more complex example

    #r "Logo" #r "SmallBasicLibrary" using static Logo; Pantalla.Mostrar();

    Pantalla.MostrarGrilla();

    Action linea = () => { Tortuga.Mover(50).GirarDerecha(); Tortuga.Mover(50).GirarDerecha(); Tortuga.Mover(50).GirarDerecha(); Tortuga.Mover(50).Girar(45); }; Repetir(8, linea); Pintar.Rectangulo ( 100 , 100 , 100 , 300 , Color.Rojo) .Rotar(angulo: 180, duracion: 1500) .Mover(duracion: 1500) .Ocultar(duracion: 1500);







    to run sample, import logo.es into xamarin workbook, then paste the code after import #r statement (press shft+enter to add newline after #r line) 
    • Edited by Tryhest Tuesday, September 5, 2017 6:12 PM
    Tuesday, September 5, 2017 4:04 PM
  • finally found a way to write sb code in xamarin(but way too complex, even for experts!)

    Tuesday, September 5, 2017 7:11 PM
  • fortunately there's always an easier way!

    just add this line: (after #r)

    using Microsoft.SmallBasic.Library;

    now u can use all sb cmds, without nasty prefixes!

    Tuesday, September 5, 2017 7:19 PM
  • similar but different: xamarin vs sb example:

     main differences:

    • var declaration
    • use of ; (eol markers)
    • for, if, loops
    • beware of capitals, it's not the same for and For

    'SB code
    GraphicsWindow.Title = "Lines"
    GraphicsWindow.Height = 800
    GraphicsWindow.Width = 1200
    GraphicsWindow.BackgroundColor = "darkblue"
    GraphicsWindow.PenColor = "White"
    
    For i = 1 To GraphicsWindow.Height 
      GraphicsWindow.PenWidth = LDMath.Sin (i*10)*10
      GraphicsWindow.PenColor = "White"
      GraphicsWindow.DrawLine(30,i*20,1200,i*20)
    EndFor
    
    For i = 1 To GraphicsWindow.Width 
      GraphicsWindow.PenColor = "darkblue"
      GraphicsWindow.PenWidth = LDMath.Sin (i*10)*10
      GraphicsWindow.DrawLine(i*20 0 i*20 1100)
    EndFor 

    //xamarin code
    #r "SmallBasicLibrary"
    using Microsoft.SmallBasic.Library;
    
    GraphicsWindow.Title = "Lines";
    GraphicsWindow.Height = 800;
    GraphicsWindow.Width = 1200;
    GraphicsWindow.BackgroundColor = "darkblue";
    GraphicsWindow.PenColor = "White";
    double aa=3.1415/180;
    
    for (int i = 1; i< GraphicsWindow.Height;i++){ 
      GraphicsWindow.PenWidth = Math.Sin (i*10*aa)*10;
      GraphicsWindow.PenColor = "White";
      GraphicsWindow.DrawLine(30,i*20,1200,i*20);
     }
     for (int i = 1; i< GraphicsWindow.Width;i++){ 
      GraphicsWindow.PenWidth = Math.Sin (i*10*aa)*10;
      GraphicsWindow.PenColor = "darkblue";
      GraphicsWindow.DrawLine(i*20,0,i*20,1100);
     }

    • Edited by Tryhest Wednesday, September 6, 2017 4:00 AM
    Wednesday, September 6, 2017 3:57 AM
  • updated xamarin example to display 2 sides of 3d head:

    int width = 800, height = 800;
    var headModel = Model.FromFile ("obj/african_head.obj");
    double f12=4;
    var image = new Image(width, height, Format.BGR);
    foreach(var face in headModel.Faces) {
        for(int j=0; j<3; j++) {
            var v0 = headModel.Vertices[face.Vertices [j]];
            var v1 = headModel.Vertices[face.Vertices [(j+1) % 3]];
            
            // scale x from [-1..1] to [0..w] 
            // scale y from [-1..1] to [0..h]
            int x0 = (int)((v0.z + 1) * width / f12); 
            int y0 = (int)((v0.y + 1) * height / f12); 
            int x1 = (int)((v1.z + 1) * width / f12); 
            int y1 = (int)((v1.y + 1) * height / f12);
            Line(image, x0, y0, x1, y1, Color.Blue);
            x0 = (int)((v0.x + 1) * width / f12); 
            y0 = (int)((v0.y + 1) * height / f12); 
            x1 = (int)((v1.x + 1) * width / f12); 
            y1 = (int)((v1.y + 1) * height / f12);
            Line(image, x0+350, y0, x1+350, y1, Color.Red);
        }
    }
    
    image.VerticalFlip ();
    image

    Wednesday, September 6, 2017 10:36 AM
  • draws 3d heads (data included inline as string): GJM689

    Thursday, September 7, 2017 2:22 PM
  • now in real 3d: TRB604

    when u apply skin:

    looks even better:

    Thursday, September 7, 2017 6:01 PM
  • updated nonki's connect4 game: LSM678-9

    • removed debug and popup window
    • bg color changed
    • added anim button

    Saturday, September 9, 2017 2:45 PM
  • upgraded further a bit: LSM678-10

    • 3d effect board
    • removed circle last move
    • added zoom effect



    • Edited by Tryhest Saturday, September 9, 2017 5:28 PM
    Saturday, September 9, 2017 5:28 PM
  • text breathing effect: TGV028
    Sunday, September 10, 2017 7:40 PM
  • text rolling v2: RTD941

    Monday, September 11, 2017 2:21 AM
  • text sensing: LGR225

    Monday, September 11, 2017 3:35 AM
  • text sensing 2 columns mode: BQJ639

    Monday, September 11, 2017 4:26 PM
  • inshape text forming & effects: QNM769

    Tuesday, September 12, 2017 6:03 AM
  • line sensing: CTL891

    Tuesday, September 12, 2017 6:21 AM
  • linsense w effects: XKM776

    Tuesday, September 12, 2017 6:31 AM
  • autumn is near: RVQ381

    Tuesday, September 12, 2017 7:15 AM
  • opposite event, now coming spring on south hemisphere: JTG660
    • Edited by Tryhest Tuesday, September 12, 2017 10:29 AM
    Tuesday, September 12, 2017 7:20 AM
  • snails moving: WFM116

     
    Wednesday, September 13, 2017 5:21 PM
  • different approach to snails animation:NST385

    Wednesday, September 13, 2017 5:45 PM
  • draws sticky lines: HPK122

    • press rmb to define start position, otherwise it draws from last postition
    • click lmb to draw line
    • press ESC to clear last drawn line
    • press F1 to clear image
    • dots helps as drawing guideline

    Thursday, September 14, 2017 7:01 AM
  • small update: WMR928

    • press shift to retain same line origin

    Thursday, September 14, 2017 10:19 AM
  • cool drawings update: WMR928-0

    move mouse around and press F3 to draw bush

    if u want to change default bush, draw a new one, then press F2 and ctrl+A to select text, then copy txt and paste it on line 7
    • Edited by Tryhest Thursday, September 14, 2017 6:48 PM
    Thursday, September 14, 2017 6:46 PM
  • Hi Team,

    Triangle Moving And Rotating

    Code = TBC447

    *Requires LD Extension (LDSHAPES)

    Thanks,

    Friday, September 15, 2017 2:52 PM
  • 4-seasons apple tree cycle: PZS041

    Monday, September 18, 2017 6:58 AM
  • palm keys effect: RZT522

    press any palm to show deeper shadow

    used palm image:

    image has transparent background. if not then u have to open it in paint.net, and select backgrnd with magic wander and press del to obtain bg transparency. then save it and reference on line 4



    • Edited by Tryhest Tuesday, September 19, 2017 4:00 AM
    Monday, September 18, 2017 7:01 PM
  • some turtle loops: BTK359


    • Edited by Tryhest Tuesday, September 19, 2017 9:53 PM
    Tuesday, September 19, 2017 7:28 PM
  • lunar libration: NXG052

    image to be saved locally and referenced on line 10:


    • Edited by Tryhest Wednesday, September 27, 2017 10:54 AM
    Tuesday, September 26, 2017 11:38 AM
  • simulates raindrops falling screen: RZM991



    • Edited by Tryhest Thursday, September 28, 2017 4:38 AM
    Thursday, September 28, 2017 4:00 AM
  • now without ldphysic: WBR494

    Thursday, September 28, 2017 4:47 AM
  • project live maps: BCV978

    picture of flags to be referenced on line 6:(updated,also for game below)




    • Edited by Tryhest Tuesday, October 3, 2017 4:17 PM
    Friday, September 29, 2017 4:29 PM
  • updated flags to a game: NLR588 

    • press rmb and select game from menu
    • click on a state represented by a flag

    Tuesday, October 3, 2017 7:34 AM
  • color space compression of image: TPZ571

    the image is compressed to 1/3 (gray zone) then is expanded

    the compression is executed by compressing image color space to 4-4-3 space. the alpha channel

    is used to compress blue component in 3-3-2 ratio. by result u can put 3 same size images into one

    under the price of some color space reduction, but resolution remains the same ( nice)) )



    the gray zone is produced only for better seeing the compressed image. othervise u can comment line 40 to see the transparent compressed image. other use can be to incorporate another gray scale image into argb image as a steganographic method. 
    • Edited by Tryhest Wednesday, October 4, 2017 10:02 PM
    Wednesday, October 4, 2017 9:50 PM
  • steganoimaging: KWN322

    good examples:

    bad example: (base image too uniform)

    steganoimaging is performed in alpha channel, so if u save image as 24 bit the hidden image is lost!


    • Edited by Tryhest Thursday, October 5, 2017 7:24 PM
    Thursday, October 5, 2017 7:22 PM
  • text analysis tool: WRP801

    can be useful to compare text styles. displays repeating ratio of words and ratio of words lesser than 8 chars to 8chr and longer words. in sample are included 3 texts, rename the desired var to tx and run sample.

    • Edited by Tryhest Sunday, October 15, 2017 7:08 AM
    Sunday, October 15, 2017 7:03 AM
  • added cmdline vars and xpand cmd and samples and sb export to xbasic: ZTP418-1

    add this quite encryptic and compacted code to try new shapes and animation features:

    !0 74;c;];= 30
    = hh 0 cc 0;n 0 1
    : ll;m $r2 %1;* 1.05;g ll 50
    = i 5 j 6 k 1 l 0;: ff
    h cc %hh 1 .5;+ hh 8
    x %i %j %k %l 0 teal %cc 0 1
    i 1 i j k l;g ff 30
    = n 0;: hh;j 482 268 %n
    - n 5;p 30;g hh


    type run 66 and numb. 66 is passed as $r2 param (max to $r9)

    default is defined on 1st line as 93

    xpand cmd xp expands prg to more readable form, u undoes it back

    also try to xam export file

    expanded version:

    added also list cmd to expand listing 







    • Edited by Tryhest Saturday, October 21, 2017 5:38 PM updates
    Monday, October 16, 2017 5:29 AM
  • turtle loops: QSL119

    (also produced if u export example 3 to sb in previous post)

    Wednesday, October 18, 2017 6:58 AM
  • knitted yarn generator:PWZ207

    Friday, October 20, 2017 5:54 AM
  • added also zoom tool: ZTP418-3

    press ctrl+mswheel to zoom in/out

    type run 11 and zoom out to obtain this output from 1st example above

    also try this sample, w zoom &fade effects:

    !0 74;c;];= 30
    = hh 0 cc 0;n 0 1
    : ll;m $r2 %1;* 1.05;g ll 50
    = i 5 j 6 k 1 l 0;: ff
    h cc %hh 1 .5;+ hh 8
    x %i %j %k %l 0 teal %cc 0 1
    o 1500 0;z 2000 0 1.3 1.3;p 100
    i 1 i j k l;g ff 30
    = n 0;: hh;j 482 268 %n
    - n 5;p 30;g hh



    • Edited by Tryhest Saturday, October 21, 2017 9:35 PM
    Saturday, October 21, 2017 5:57 PM
  • debugger for xbasic : ZGL846

    try to debug this code:

    c;[ w:l_60:w:r_120:w:l_60:w :
    = mm %1 dd 0
    } ss 40;g xxx
    : ss;= ll %$1 g 0 h 0 n 1
    : lp;# g mm %n;[ %g  _
    = h %# g 0;# g h 2
    = c 0;# c h 1
    y "%c"="l" 2;a -%g 0
    y "%c"="r" 2;a %g 0
    y "%c"="f" 2;a 0 %ll
    y "%c"="w" 13
    y %dd<2 10;+ dd 1 
    > n st;> ll st;/ ll 2
    } ss %ll
    < ll st;< n st
    - dd 1;g jj;a 0 %ll
    : jj;y %n<7 3;+ n 1;g lp;r
    : xxx


    press F7 to start debugging / trace
    • Edited by Tryhest Tuesday, October 24, 2017 4:20 AM
    Tuesday, October 24, 2017 4:19 AM
  • added recursion and bettered explainer:  WZC044

    Tuesday, October 24, 2017 5:59 PM