Menu

LGT

2020-12-27
2020-12-30
  • stan cartwright

    stan cartwright - 2020-12-27

    They are sorted except ili touch only on software spi
    but nice cheap fast devices. Tell people to order one
    a nano on fire...well not a nano but looks like one...
    but it's logic green,..which reminds me of an old sci-fi film.
    they're really fun to do glcd with,
    a 328 would beat most pics. this one's been in the gym
    https://www.youtube.com/watch?v=2yhQedg1-zA

     
  • stan cartwright

    stan cartwright - 2020-12-28

    what would this be in gcb please?

     
    • Anobium

      Anobium - 2020-12-29

      What is the question Stan ?

      Video shows the performance. Nice.
      Touch is sorted. You just have to use an SPI frequency that the Touch chip supports.

       
  • stan cartwright

    stan cartwright - 2020-12-29

    I looked up "rotating cube basic". sorry, I thought I added link.
    Some code from Rosetta code but most old basics use floating point..ie pi or decimal point.
    I got a spectrum and commoder 64 basic cube rotate basic programme but even those seem difficult to convert to gcb.
    I thought 3d graphics would be a good test for LGT.

     
  • stan cartwright

    stan cartwright - 2020-12-29

    DECLARE FUNCTION POINTY (Yy, Zz, Zoff, Yoff)
    DECLARE FUNCTION POINTX (Xx, Zx, Zoff, Xoff)

    ;TYPE PNT
    ;X AS INTEGER
    ;Y AS INTEGER
    ;Z AS INTEGER
    ;END TYPE

    CUBEL = 11
    DIM CUBE(CUBEL)

    RESTORE CUBE
    FOR Loop1 = 0 TO CUBEL
    READ CUBE(Loop1, 0).Xx, CUBE(Loop1, 0).Yy, CUBE(Loop1, 0).Zz
    READ CUBE(Loop1, 1).Xx, CUBE(Loop1, 1).Yy, CUBE(Loop1, 1).Zz
    NEXT

    SCREEN 13

    FOR Z = 400 TO 50 STEP -2
    FOR Loop1 = 0 TO CUBEL
    X1 = POINTX(CUBE(Loop1, 0).Xx, CUBE(Loop1, 0).Zz,zz. 160)
    Y1 = POINTY(CUBE(Loop1, 0).Yy, CUBE(Loop1, 0).Zz, Zz, 100)
    X2 = POINTX(CUBE(Loop1, 1).Xx, CUBE(Loop1, 1).Zz, Zz, 160)
    Y2 = POINTY(CUBE(Loop1, 1).Yy, CUBE(Loop1, 1).zZ, zZ, 100)
    LINE (X1, Y1)-(X2, Y2), 4
    NEXT
    ;WAIT &H3DA, 8
    FOR Loop1 = 0 TO CUBEL
    X1 = POINTX(CUBE(Loop1, 0).X, CUBE(Loop1, 0).Z, Z, 160)
    Y1 = POINTY(CUBE(Loop1, 0).Y, CUBE(Loop1, 0).Z, Z, 100)
    X2 = POINTX(CUBE(Loop1, 1).X, CUBE(Loop1, 1).Z, Z, 160)
    Y2 = POINTY(CUBE(Loop1, 1).Y, CUBE(Loop1, 1).Z, Z, 100)
    LINE (X1, Y1)-(X2, Y2), 0
    NEXT
    ;WAIT &H3DA, 8
    NEXT

    FOR Loop1 = 0 TO CUBEL
    X1 = POINTX(CUBE(Loop1, 0).X, CUBE(Loop1, 0).Zz, Zz, 160)
    Y1 = POINTY(CUBE(Loop1, 0).Y, CUBE(Loop1, 0).Zz, Zz, 100)
    X2 = POINTX(CUBE(Loop1, 1).X, CUBE(Loop1, 1).Zz, Zz, 160)
    Y2 = POINTY(CUBE(Loop1, 1).Y, CUBE(Loop1, 1).Zz, Zz, 100)
    LINE (X1, Y1)-(X2, Y2), 4
    NEXT

    CUBE:
    DATA -10,-10,-10, 10,-10,-10
    DATA -10,-10,-10,-10, 10,-10
    DATA -10, 10,-10, 10, 10,-10
    DATA 10,-10,-10, 10, 10,-10
    DATA -10,-10, 10, 10,-10, 10
    DATA -10,-10, 10,-10, 10, 10
    DATA -10, 10, 10, 10, 10, 10
    DATA 10,-10, 10, 10, 10, 10
    DATA -10,-10, 10,-10,-10,-10
    DATA -10, 10, 10,-10, 10,-10
    DATA 10, 10, 10, 10, 10,-10
    DATA 10,-10, 10, 10,-10,-10

    FUNCTION POINTX (X, Z, Zoff, Xoff)
    POINTX = ((256 * X) / (Z - Zoff)) + Xoff
    END FUNCTION

    FUNCTION POINTY (Y, Z, Zoff, Yoff)
    POINTY = ((256 * Y) / (Z - Zoff)) + Yoff
    END FUNCTION

     
  • Anobium

    Anobium - 2020-12-30

    Function What( post as string )
    Call What?
    End Function

    :-)

     
    • Chris Roper

      Chris Roper - 2020-12-30

      Should that function not be:

      Function LGBT( Leaning as Byte )

      Non of the disadvantage groups should be excluded.
      GCBasic strives to interface with all peripherals regardless of connector type.

       

      Last edit: Chris Roper 2020-12-30
  • stan cartwright

    stan cartwright - 2020-12-30

    You try to rotate a cube in gcb.
    I can rotate a square in gcb using trig but the easy explanations of rotating 8 points around a centre
    x,y,z and joining the points has not been easy to understand like the example programs I found show basics are so different.
    It was only an idea.
    another idea was the asteroids game but different glcd displays handle of screen drawing different.
    like if a box was partially off screen you would know where it's x.y was because seems to use word values.
    If you use a 320x240 screen and pset x,y and loop increasing or decreasing x,y it goes off screen and after a while appears on the other side with no error reports...
    well you don't get them when a program is running...it would just freeze/crash.
    so asteroids one day using vectors not sprites

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.