QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Qwerkey on February 25, 2020, 05:48:33 am

Title: Samples Gallery
Post by: Qwerkey on February 25, 2020, 05:48:33 am
In our 500Up! thread, bplus made the suggestion that we might nominate (and vote for) members and their programs for inclusion in the Samples Gallery (which at present is a little bare – Ursa Minor! *).  That method would perhaps be a little cumbersome and folks don't want to spend time doing that.

Here's my suggestion - STxAxTIC has suggested having Junior Librarians to help him:

A Junior Librarian (who has been given the necessary permission) would contact the Top 20 Starters by e-mail - these folk must be the most deserving - and request that they select one Program which they would like to submit to the Samples Gallery.  The Junior Librarian, when he has satisfied himself/herself that the Program meets STxAxTIC's selection criteria will then add this to the Gallery.  This method would be in addition to the existing method of self-application to the Head Librarian.

As we currently have 16 samples, this would bring us up to about 35 and should give a broader range of applications.

I assume that the Junior Librarian would be able to access a more complete set of Site Statistics so that he/she can determine who the Top 20 Starters are (only 10 are visible in the normal stats).

This is a sufficiently non-technical task that I'd volunteer for this job.

Separately there could be a similar Junior Librarian Post for Toolbox which would be sufficiently technical that I would not qualify.

Worthy of pursuing, or another duff Qwerkey suggestion?

* Sorry, I couldn't resist the temptation of an astronomical pun.
Title: Re: Samples Gallery
Post by: Ashish on February 25, 2020, 07:44:38 am
Can someone please add this to sample gallery -> https://www.qb64.org/forum/index.php?topic=1139.msg103744#msg103744
and
https://www.qb64.org/forum/index.php?topic=1453
Title: Re: Samples Gallery
Post by: bplus on February 25, 2020, 09:53:07 am
Voting would solve a couple problems that would otherwise be more work for whomever does the library work:
1) verifies it works for others
2) entertains or does something positive that causes a person to vote
3) or proves someone has a bunch of fans which I think is OK too
4) It might get more participation at this forum and help membership be more meaningful

Here I am talking about samples not toolbox items.
Title: Re: Samples Gallery
Post by: Qwerkey on February 25, 2020, 10:10:16 am
bplus, I agree with everything you say (and I'd like such a system).  I just thought that not many of us would want to do the voting thing.  We'll see what the opinions are.
Title: Re: Samples Gallery
Post by: _vince on February 25, 2020, 10:10:37 am
Vince Tetris #1!!!
Title: Re: Samples Gallery
Post by: bplus on February 25, 2020, 12:41:37 pm
bplus, I agree with everything you say (and I'd like such a system).  I just thought that not many of us would want to do the voting thing.  We'll see what the opinions are.


I wonder if my belief in democracy is a bit naive. I got to wondering about quality of votes which is specially an issue when the numbers are small. eg could we weight votes by # of replies, no because some people come just to chat and that's fun and some come bearing a precious give and then go again, hit and run in a good way. :)
Title: Re: Samples Gallery
Post by: FellippeHeitor on February 25, 2020, 12:46:43 pm
Just head over to the Programs board and click the "Replies" heading and you'll have a list sorted by number of replies, if that's any indicative of popularity.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

PS: Sorting by view sure does give a good insight, as those will have been "seen" even by non-members browsing the forum, likely indicating the ones with most attractive titles.
Title: Re: Samples Gallery
Post by: STxAxTIC on February 25, 2020, 01:31:45 pm
If our numbers were in the hundreds I would be in favor of an active democracy, but for now we have what I will call a "passive" one. Itll be too obvious to reverse engineer who voted for what - so I like Fellippes idea... but this only works to first order in the sense that reply and view count is not indicative of the success of any particular program. Instead, these numbers measure at the very least the clickbait factor, maybe in some cases the efficacy of code
Title: Re: Samples Gallery
Post by: bplus on February 25, 2020, 03:58:34 pm
Can someone please add this to sample gallery -> https://www.qb64.org/forum/index.php?topic=1139.msg103744#msg103744
and
https://www.qb64.org/forum/index.php?topic=1453

Hi Ashish,

I will second the motion if you make clear with Best Answer checked and promise you are done modifying :)
(Who is ever completely satisfied? )
Title: Re: Samples Gallery
Post by: Ashish on February 26, 2020, 03:19:11 am
Hi Ashish,

I will second the motion if you make clear with Best Answer checked and promise you are done modifying :)
(Who is ever completely satisfied? )
@bplus
I have checked best answer.  Please add these to samples gallery.. I am trying this for almost a year... The Librarian never replies to my mail....
:'(
Title: Re: Samples Gallery
Post by: Qwerkey on February 26, 2020, 04:43:19 am
If everybody is happy, we'll go along the lines of Fellippe - the Most Replies sort list is the beginning of the method.  The Junior Librarian will then use his/her intelligence to contact members for Samples submissions.

I volunteer for the post.  How do I get the permission status of STxAxTIC, so that I can add posts?

Ashish, please be patient a while longer while we sort out who is doing what (I should be able to have more time than our hard-pressed Head Librarian, if I'm given the job).
Title: Re: Samples Gallery
Post by: STxAxTIC on February 26, 2020, 07:55:06 am
Wham, you have my permission.

Provided you join discord! Jk. Well you should. If you think the forums are hot, that place is much hotter. Someone will beam you the password once you get there. (If you really can't then we'll do something else.)
Title: Re: Samples Gallery
Post by: bplus on February 26, 2020, 11:49:51 am
@bplus
I have checked best answer.  Please add these to samples gallery.. I am trying this for almost a year... The Librarian never replies to my mail....
:'(

Yes thanks, the ones you want to show are now easy to find and make a quick check to see they work on my system and are great and demo 3D _GL.

I second the motion for both Ashish links but I think Qwerkey is already on the case! I think TerryRitchie favorable reply since nomination counts as a vote.

I don't agree with the number of replies criteria because they could be about anything just looking at top 10, Ashish Moving in Matrix Rain is about only one about one thing and the Inform one is about leaning Inform with more than trivial example, it was pretty good. I would nominate that as well as Qwekey's Crossword Generator because it generated interest from members otherwise mostly inactive.

Totally in favor of Qwerkey helping STxAxTIC it's a big job.

@Qwerkey
Quote
If everybody is happy, we'll go along the lines of Fellippe - the Most Replies sort list is the beginning of the method.

Fellippe said most 'views" not replies:
Quote
PS: Sorting by view sure does give a good insight, as those will have been "seen" even by non-members browsing the forum, likely indicating the ones with most attractive titles.

 that is an insight but views tend to grow in faddish explosion of numbers, people look at what other people are looking at and replies add to explosion.

Again I say nominate, get a second, take a vote after time has put things in place in memory. The vote is judged by quality of comments as well as number.

And since it's not too cool for librarians or their assistants to self nominate and get selected without due process, I am prepared to nominate some of Qwerkey's projects. STxAxTIC's is harder to judge, he works on different level with physics and math interest and brings in his previous "PL" which I think is lambda based?, which makes things very rich, ie PhD applied computer science, but esoteric. For him, I would take him by his word, if he says it's good it probably is ;-))




Title: Re: Samples Gallery
Post by: Qwerkey on February 27, 2020, 04:56:45 am
Wham, you have my permission.

Provided you join discord! Jk. Well you should. If you think the forums are hot, that place is much hotter. Someone will beam you the password once you get there. (If you really can't then we'll do something else.)

OK, I'll sign up and head over there, and we'll take it from there.
Title: Re: Samples Gallery
Post by: _vince on February 27, 2020, 08:55:07 pm
The original 'The QBasic Forum' had a 'Programs you're proud of' section where individual users could start a thread, titled with their name, and reply with their own programs for a more refined list. I would love something like that as a subforum of the programs section open selectively to deserving users where each thread is their own, replies are individual programs, and no comments by other users are allowed. Some kind of style and consistency could be lightly enforced. I feel like the 'samples' section should be kept short and highly selective for stuff that's polished and refined and paints QB64 in a good light with programs that are readily consumable, not even necessarily the most impressive or largest projects, though it could certainly use a reshuffling in its current state.
Title: Re: Samples Gallery
Post by: bplus on February 27, 2020, 09:29:05 pm
The original 'The QBasic Forum' had a 'Programs you're proud of' section where individual users could start a thread, titled with their name, and reply with their own programs for a more refined list. I would love something like that as a subforum of the programs section open selectively to deserving users where each thread is their own, replies are individual programs, and no comments by other users are allowed. Some kind of style and consistency could be lightly enforced. I feel like the 'samples' section should be kept short and highly selective for stuff that's polished and refined and paints QB64 in a good light with programs that are readily consumable, not even necessarily the most impressive or largest projects, though it could certainly use a reshuffling in its current state.

Nice idea!
Title: Re: Samples Gallery
Post by: Qwerkey on February 28, 2020, 04:26:32 am
the 'samples' section should be kept short and highly selective for stuff that's polished and refined and paints QB64 in a good light with programs that are readily consumable

That's what I shall aim for.  A small selection of programs like _vince's Tetris!
Title: Re: Samples Gallery
Post by: _vince on February 28, 2020, 03:44:04 pm
That's what I shall aim for.  A small selection of programs like _vince's Tetris!
It was my intent to write the 'de facto official qb64 tetris' with it, whether I achieved it, I don't know, but I do play that very program (well, mainly pentris now) almost daily and compulsively, especially when watching yt videos
Title: Re: Samples Gallery
Post by: bplus on February 29, 2020, 01:05:23 pm
Congrats to Qwerkey and Ashish!

Oh, and belated one to _vince :)
Title: Re: Samples Gallery
Post by: Ashish on February 29, 2020, 01:13:07 pm
R1 For @Qwerkey
Code: QB64: [Select]
  1. ? "Thank You ";
  2.  
Title: Re: Samples Gallery
Post by: STxAxTIC on February 29, 2020, 01:46:24 pm
Thanks for the recent efforts guys - honestly I haven't even looked at the results yet - I'm sure they're great. Feel free to reorganize what's already there, including delete stuff. (I don't care whether any of my code is up there or not, it was really just filler and doesn't show off qb64 at all.)
Title: Re: Samples Gallery
Post by: Qwerkey on March 01, 2020, 04:36:06 am
Guys, as you have seen I've added one of Ashish's programs to the Samples Gallery.  And now I will begin a programme of adding further submissions to advertise QB64's fantastic capabilities.

Ashish, for your sample I used the code from Reply #34 of your post (as you directed), but when I run that code, I do not get any sky imaging, just terrain.  Did I do something wrong?  Would you check this, thanks?

bplus, we're still looking for someone to do the Toolbox, and you'd be ideal.  Would you be able and interested to do that?  If you're looking for a job to be done, ask a busy person!
Title: Re: Samples Gallery
Post by: Qwerkey on March 01, 2020, 05:36:38 am
Ashish, for the present I am not going to add your "Moving into the Matrix Rain" project into Samples.  It should be there on at least two counts: i) another outstanding Ashish program, ii) most viewed program.  But firstly, I want to get work from as many other people as possible.
Title: Re: Samples Gallery
Post by: Qwerkey on March 01, 2020, 06:34:26 am
I have added Steve's QB64 Spell Checker to the Samples.  This for a number of qualifying reasons: i) must have something by Steve (though I'm sure that others will have to follow), ii) it is near highest in views, iii) STxAxTIC wanted it there (or in Toolbox actually, but I decided that it's a sample program rather than a general coding tool).
Title: Re: Samples Gallery
Post by: Qwerkey on March 01, 2020, 06:52:35 am
You will not be surprised to learn that a certain skill is required in choosing samples from the most-viewed programs, and selection has to be done with care.  Steve's QB64 Spell Checker (with 4250 views) has been added, but we find the program "My First InForm Program - Trackword" by Qwerkey (who let him onto the site???) has 4253 views.  But we're not putting that program into Samples as it is very narrow in its appeal.  It is an InForm program, which is a definite plus, and I shall want to advertise InForm in Samples, but not with that program, I think.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 12:57:48 pm
Quote
bplus, we're still looking for someone to do the Toolbox, and you'd be ideal.  Would you be able and interested to do that?  If you're looking for a job to be done, ask a busy person!

Thanks for thinking of me Qwerkey but I don't think I am as technically proficient as Steve, RhoSigma, Fellippe or Terry to name a few. I am learning from these guys and not in position to judge. I remember being worn out chasing down bugs in Steve's date-time thing and I think STxAxTIC felt close to same when we were working out ellipsis tools. This is why advocate nomination, a 2nd and a vote then you have perspective of more minds than one. With tools, I think the hammering out process is particularly important (sort of what I mean by voting). Hey! if guys can support this idea I will try and host it.

BTW Steve's spell checker does strike more as a tool than as sample and doing a Games board is great idea too!

And for Inform, I can support Qwerkey's crossword thing as I said it got response from folks who don't normally participate much but hey! what comes first in Fellippe's mind?, he is the expert for that. :)

Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 01:28:49 pm
I still think a few more hands on deck wouldn't necessarily hurt. I'm thinking specifically of mr bplus. Whatdya' say? What some Librarian power? That way you can at least curate your own entries. We 100% trust you, this has been discussed.
Title: Re: Samples Gallery
Post by: lawsonm1 on March 01, 2020, 01:52:37 pm
So I guess along a similar vein; I ordered three sets of old books, Microsoft Basic 7.0 Programers Guide / Language Reference, Waite Group's Microsoft QuickBASIC Bible, and Basic Programs for Scientists and Engineers. I received the PDS manuals last week and the other two will be here in a few days. The PDS manuals(binders) are in incredibly excellent shape. There are a lot of programs listed in the books. If there is any interest I will probably enter them in my machine and run them. I can post them if anyone is interested. Mike
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 01:53:58 pm
Yes, the more the merrier. We're here not only for the present and future, but to not let down the past.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 02:10:59 pm
I still think a few more hands on deck wouldn't necessarily hurt. I'm thinking specifically of mr bplus. Whatdya' say? What some Librarian power? That way you can at least curate your own entries. We 100% trust you, this has been discussed.

OK let me know how I can help.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 02:59:20 pm
Hey bplus - if all went right, you should now have edit power over the domains we were mentioning. Don't be bashful at all - you're a top generator here.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 03:33:43 pm
Thanks does this include any of the new Child Boards I see under samples?

If so, I'd say to Terry point me to your best game. Update: Oh we have Wide screen Asteroids!

If it's just Tools, I'd ask Terry, Did you have something for doing menus? or anyone? or a text editor that fits in a box.

Title: Re: Samples Gallery
Post by: TerryRitchie on March 01, 2020, 03:42:04 pm
Over the last 10 years I have written quite a few games, code, and libraries. Give me a few days to go through my NAS backups over the past 10 years and see what I can dig up.
Title: Re: Samples Gallery
Post by: The Librarian on March 01, 2020, 03:44:31 pm
You both (Querkey and bplus) have full-blown power over the main boards and sub-boards. (Subordinates? lol) Anyway.

And yes Terry - let's showcase your effort. You've been a force of nature around here. Just find whatever posts and either bump them or make new threads, its all good.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 04:26:09 pm
@RhoSigma and @SMcNeill, do you guys want to point me at anything of yours?

Is that compression routine in v1.4 now?
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 04:57:03 pm
Well I had to put up one of mine just to see, draw spinners, hope you all like it. :)

@Petr you had a music player going that was popular could you point me to that?

And anyone who wants to nominate another or them self let me know and or 2nd someone else nomination.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 05:01:30 pm
I could swear there was a hex editor in QB64 somewhere floating around... Anyone recall that?

EDIT:

Ah here: https://www.qb64.org/forum/index.php?topic=204.0 (https://www.qb64.org/forum/index.php?topic=204.0)

Anyone wanna stress-test that?
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 05:07:43 pm
Quote
Well I had to put up one of mine just to see, draw spinners, hope you all like it. :)

We're being very tight about the format. Please include a perfectly trimmed screenshot, italics under Description. Please too shorten the reference URL if you can... The authors list goes in ABC order. Don't make us hunt around.

(https://www.qb64.org/forum/index.php?topic=2272.0 (https://www.qb64.org/forum/index.php?topic=2272.0))

EDIT Damn now I see why no screenshot. You're exempt on that one. By the same token, don't say there's a surprise right in the description. Either give it all away, or give nothing away, rite?
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 05:31:07 pm
We're being very tight about the format. Please include a perfectly trimmed screenshot, italics under Description. Please too shorten the reference URL if you can... The authors list goes in ABC order. Don't make us hunt around.

(https://www.qb64.org/forum/index.php?topic=2272.0 (https://www.qb64.org/forum/index.php?topic=2272.0))

EDIT Damn now I see why no screenshot. You're exempt on that one. By the same token, don't say there's a surprise right in the description. Either give it all away, or give nothing away, rite?

OK? Steve and Petr just offered alternate ways to do graphics but mine works fine, I think.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 05:38:38 pm
(I'm only being so touchy about it so we have the same template going on. That stuff really stands out to some people! That Librarian is a real pedant.)
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 05:44:57 pm
(I'm only being so touchy about it so we have the same template going on. That stuff really stands out to some people! That Librarian is a real pedant.)

:) that's OK and I will assume changes are OK.
Title: Re: Samples Gallery
Post by: TerryRitchie on March 01, 2020, 09:01:04 pm
Ok, after running a search through my NAS this is the some of the more popular stuff I've submitted over the years. Feel free to use any of it.

Some of this stuff (especially the simpler games) were written for the QB64 class I used to teach in high school.

Ritchies Code.ZIP
-- Games
---- BadBox - A simple game that shows off collision detection (for QB64 class)
---- BadBox Revenge - an advanced version of BadBox showing how to do rotation and angular math (for QB64 class)
---- Classroom Jeopardy - A Jeopardy game I wrote to use in the classroom. Needs teacher input to play, not a stand alone game.
---- FlappyBird - Yep, I cloned Flappy Bird on a Saturday afternoon. Used in QB64 class.
---- Frogger - A clone of the coin-op Frogger. 95% complete (not all levels finished)
---- HangMan - A screen 0 hangman game. Two version, one with and one without subroutines. (for QB64 class)
---- Kaboom - My attempt at a clone of Kaboom by activision for the Atari 2600 (requires SDL version of QB64, uses MIDI files)
---- MineSweeper - A clone of Microsoft's Mine Sweeper game.
---- PacMan - A clone of the coin-op PacMan game. 80% complete, no collision detection implemented yet.
---- QB64 Asteroids - An asteroids clone I made to test the sprite library I created.
---- QB64 Invaders - A space Invaders clone I made to test the sprite library I created.
---- QB64 Pong - A Pong clone created for the QB64 class.
---- QB64 Simon - A clone of the 1980's Simon electronic game.
---- QBZerk - A clone of the coin-op game Berzerk from 1980 by Stern
---- Space Invaders - A true clone of the coin-op game Space Invaders (98% complete)
---- Super Mario Jump - A silly little game created for the QB64 class.
---- Super Megabug - The game I was working on in QB45 when I discovered QB64 (required SLD version of QB64, uses MIDI files)
---- Widescreen Asteroids - An asteroids clone I wrote with enhancements I felt should be in the original.

-- Libraries
---- Button - A button library with included documentation.
---- Graphics Line Input - A graphical line input command library with included documentation.
---- Menu - A library for creating Windows style menus in QB64 with included documentation.
---- Sprite - The sprite library I wrote back in 2011 with included documentation.

-- Misc
---- Hocus Pocus - A graphics demo showing how to create soft particle effects.
---- iOS Clone - An icon drag and drop thingy I was working on. Reminds me of how you can move icons around in iOS (iPad, iPhone, etc..)
---- LED Maker - An LED sign maker
---- MrSmiley - Shows the difference between INKEY$ and _KEYDOWN (made for QB64 class)
---- Physics - A couple physics demos showing circles bouncing off each other (think pool balls)

-- QB45
---- Etch a Sketch - An Etch a Sketch I made back in 2006 before QB64. I'm from Ohio, Etch a Sketch was invented in Ohio. I had to :-)

Download from here: https://www.qb64sourcecode.com/RitchiesCode.zip

Can't attach for some reason.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 09:06:43 pm
Sounds excellent, this is quite a legacy to digest. Thanks so much!

Just looking for the zip...
Title: Re: Samples Gallery
Post by: TerryRitchie on March 01, 2020, 09:13:07 pm
Sorry, I had to upload it to my web site. The forum would not attach it.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 09:48:15 pm
Wow Terry!

I remember a few of those, even modifying Flappy. Mineweeper was like an exact duplicate of MS Windows version. QBzerk was that moving around cubes? looks like Widescreen Asteroids was good pick.

Me, I am going to check Menu because I was asking for that earlier.

Indeed a legacy.

Update: Nope QBzerk is running around mazes 1980's Arcade game style. Opens with Asimov's 3 Laws for robots. I think I heard a clip from Pink Floyd.
Title: Re: Samples Gallery
Post by: TerryRitchie on March 01, 2020, 10:18:44 pm
Update: Nope QBzerk is running around mazes 1980's Arcade game style. Opens with Asimov's 3 Laws for robots. I think I heard a clip from Pink Floyd.

Read those laws again ;-)  The robots rule in this game.
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 10:21:24 pm
Ah, that makes more sense for this game :) You know I might have missed that the first time too,  deja vu again!
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 11:35:05 pm
bplus, saw your recent post.

It was supposed to be two ZIP files, appended to the original post.

Okay, weird how they fit in Programs...

(yall're turning me into clippy)
Title: Re: Samples Gallery
Post by: bplus on March 01, 2020, 11:39:43 pm
bplus, saw your recent post.

It was supposed to be two ZIP files, appended to the original post.

Okay, weird how they fit in Programs...

(yall're turning me into clippy)

Sorry, that is what I tried for but https://www.qb64.org/forum/index.php?topic=2273.msg115066#msg115066
Title: Re: Samples Gallery
Post by: STxAxTIC on March 01, 2020, 11:41:50 pm
Oh man yeah I'm getting tired, missing some of the updates. Thanks again m8.
Title: Re: Samples Gallery
Post by: RhoSigma on March 02, 2020, 04:49:17 am
@RhoSigma and @SMcNeill, do you guys want to point me at anything of yours?

EDIT:
Just put on hold for a while, just found another quirk in it, let you know when ready...


EDIT2:
So finally here's the correct routine, there was a mistake in the negative value barrier check.
Unfortunately I can't correct it in the mentioned post below, as that thread is already locked...

Code: QB64: [Select]
  1. '---------------------------------------------------------------------
  2. 'Function:  Convert any given dec/hex/oct number into a binary string.
  3. '           Can handle positive and negative values and works in that
  4. '           similar to the QB64 built-in HEX$ and OCT$ functions.
  5. '
  6. 'Synopsis:  binary$ = BIN$ (value&&)
  7. '
  8. 'Result:    binary$ --> The binary representation string of the given
  9. '                       number without leading zeros for positive values
  10. '                       and either 8/16/32 or 64 chars for negatives,
  11. '                       depending on the input size.
  12. '
  13. 'Inputs:    value&& --> The pos./neg. number to convert, may also be
  14. '                       given as &H or &O prefixed value.
  15. '
  16. 'Notes:     You may also pass in floating point values, as long as its
  17. '           represented value fits into the _INTEGER64 (&&) input, hence
  18. '           approx. -9.223372036854776E+18 to 9.223372036854776E+18.
  19. '           Different from HEX$ and OCT$, BIN$ won't throw an overflow
  20. '           error, if this range is exceeded, but the result is probably
  21. '           wrong in such a case.
  22. '---------------------------------------------------------------------
  23. FUNCTION BIN$ (value&&)
  24. '--- option _explicit requirements ---
  25. DIM temp~&&, charPos%, highPos%
  26. '--- init ---
  27. temp~&& = value&&
  28. BIN$ = STRING$(64, "0"): charPos% = 64: highPos% = 64
  29. '--- convert ---
  30.     IF (temp~&& AND 1) THEN MID$(BIN$, charPos%, 1) = "1": highPos% = charPos%
  31.     charPos% = charPos% - 1: temp~&& = temp~&& \ 2
  32. LOOP UNTIL temp~&& = 0
  33. '--- adjust negative size ---
  34. IF value&& < 0 THEN
  35.     IF -value&& < &H0080000000~&& THEN highPos% = 33
  36.     IF -value&& < &H0000008000~&& THEN highPos% = 49
  37.     IF -value&& < &H0000000080~&& THEN highPos% = 57
  38. '--- set result ---
  39. BIN$ = MID$(BIN$, highPos%)
  40.  
  41.  

NOTE: The function here is obsolete and buggy, use for reference only!!
The only thing I think of, regarding the &B enhancements in v1.4, would be to replace the old, slow, and non-negativ numbers able BIN$ in the ToolBox board with this one: https://www.qb64.org/forum/index.php?topic=1933.msg112096#msg112096
Title: Re: Samples Gallery
Post by: Ashish on March 02, 2020, 05:37:56 am
@Qwerkey
It runs fine on my machine. Sky is looking good. Can you share a screenshot of that? Have anyone else found this issue?
Ok. It is fine to *not* to my "Moving into the matrix rain" program.
Oh! There's a games section too..
@Qwerkey @bplus Please add my game Hunter's Revenge https://www.qb64.org/forum/index.php?topic=345.msg2322#msg2322
Title: Re: Samples Gallery
Post by: RhoSigma on March 02, 2020, 07:56:33 am
bump: https://www.qb64.org/forum/index.php?topic=2233.msg115086#msg115086
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 10:40:06 am
Quote
The only thing I think of, regarding the &B enhancements in v1.4, would be to replace the old, slow, and non-negativ numbers able BIN$ in the ToolBox board with this one: https://www.qb64.org/forum/index.php?topic=1933.msg112096#msg112096

Hi Rho,

Makes sense to update toolbox BIN$ with complement to &B enhancements in QB64 v1.4 by same author.

I think we want to replace BIN$ in Toolbox with the one found in "A few pushes to Development Build" Reply #35, last Edit Dec 17, 2019"
https://www.qb64.org/forum/index.php?topic=1933.msg112096#msg112096

So that is what I will try.
Title: Re: Samples Gallery
Post by: RhoSigma on March 02, 2020, 10:59:46 am
I think we want to replace BIN$ in Toolbox with the one found in "A few pushes to Development Build" Reply #35, last Edit Dec 17, 2019"
https://www.qb64.org/forum/index.php?topic=1933.msg112096#msg112096

So that is what I will try.

NO - NO - NO
I wrote I still found another bug in it, please take the corrected function from here instead: https://www.qb64.org/forum/index.php?topic=2233.msg115086#msg115086
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 11:31:23 am
NO - NO - NO
I wrote I still found another bug in it, please take the corrected function from here instead: https://www.qb64.org/forum/index.php?topic=2233.msg115086#msg115086

Roger that but can you guess why I got confused?

IMO you should have not made that note but I bet you were trying to be careful :)

I have it changed, how is it now?
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 12:03:35 pm
Roger that but can you guess why I got confused?

IMO you should have not made that note but I bet you were trying to be careful :)

I have it changed, how is it now?

Oops, needed to update the URL too, OK now what?

@STxAxTIC had to use the whole length in URL to point exactly to RhoSigma's reply, I got a demo and screenshot myself.

@RhoSigma does the output from demo look OK? (neg numbers are a bit of surprise for me.)
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 12:14:22 pm
Quote
@Qwerkey @bplus Please add my game Hunter's Revenge https://www.qb64.org/forum/index.php?topic=345.msg2322#msg2322

@Qwerkey @STxAxTIC  what do you say to every member (over a certain level of contribution to this forum) getting 1 game of their choosing, be it theirs or someone else? This sort of falls in with _vince idea too. The game can be replaced as they progress and mature.
Title: Re: Samples Gallery
Post by: RhoSigma on March 02, 2020, 12:32:39 pm
Roger that but can you guess why I got confused?

IMO you should have not made that note but I bet you were trying to be careful :)

I have it changed, how is it now?

Well sorry b+,
yes it looks correct now, so other people can use it without issues.

Just noticed the mistake a few minutes after my first post. Wish there would be a delay before a post is actually shown in the forum, and that one could completly revoke the post within the delay time, or at least tick it to be postponed until the author finally releases it.

Also the locking of threads comes contra productive here, as I can't change the codebox in the "Development" thread to contain the corrected version. Hence everybody who's searching the forum for BIN$ and stumbles over the buggy version first instead of the now correct version in the ToolBox, will probably use the buggy function, at least until it bites his ass.

In the future I'll restrict myself to only posting codeboxes/attachements in the "Programs" board, where no locking is active and I'm able to correct things when needed.


Oh, just see another reply, so here is the answer for that one.

The output looks as intended by me, here an example to show pos./neg. number behavior at the _BYTE barrier:
Code: QB64: [Select]
  1. '  128 =         10000000 (8 unsigned data bits)
  2. '  127 =          1111111 (7 unsigned data bits)
  3. ' -127 =         10000001 (  normal sign + 7 data bits)
  4. ' -128 = 1111111110000000 (extended sign + 7 data bits)
note the sign extension for -128, so it can be distinguished from +128, it's similar at the INTEGER/LONG barriers.

However, if you have better sugestions it should be easy enough to adapt the function.
Title: Re: Samples Gallery
Post by: Qwerkey on March 02, 2020, 12:33:48 pm
@bplus: When doing the Samples Gallery I am aiming to include at least 1 superior program from all high contributors.  It seems only fair.
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 12:47:50 pm
@bplus: When doing the Samples Gallery I am aiming to include at least 1 superior program from all high contributors.  It seems only fair.

Absolutely, for Samples.

@Qwerkey, Sorry, I should clarify, I am referring to the Games Board that Ashish wants his first Hunter Game entered. I am thinking you might be reluctant to consider because he has a marvelous Sample already.

But for Games a whole other board, we could allow everyone one, their best (or even someone else as long as we don't have that yet.) That seems both fair and a chance for everyone to offer a demo of their stuff (and that way, we you, STxAxTIC and I don't have to judge one over another because the idea of that gives me ulcers. Look at TerryRitchie's set, you can choose one?)
Title: Re: Samples Gallery
Post by: Qwerkey on March 02, 2020, 01:22:03 pm
@bplus I think that we are in agreement.  At least 1 in Samples and 1 in Games.  But we defer to The Librarian.  I am hoping that The Librarian will lay a couple of ground rules for us.  It will be what he (or she: this nebulous personality we don't know!) wants.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 02, 2020, 01:40:23 pm
Whoa boys.

I'm on the road today and may not be reading very carefully but the sense I'm getting is you want to bypass the stringent filtration process and just let people nominate their favorite program. No. No explicit voting either. This approach completely misunderstands why we have a Programs board in the first place. That is the arena where are things are decided. Let me remind too that any code that ends up on our curated boards must pass through Programs first.

Taking Terry's list as an example, I'd say probably 90% of it is polished and ready. And suddenly we have to choose one? Nope. This isnt a place where we should feel overwhelmed by some coders being more prolific than others. We arent here to be fair to the members, we are being fair to the readers. Let's offer only the best.
Title: Re: Samples Gallery
Post by: Qwerkey on March 02, 2020, 01:54:16 pm
@STxAxTIC Thanks, we're certainly going to be stringent.  We'll do the tasks nice and gently.
Title: Re: Samples Gallery
Post by: bplus on March 02, 2020, 02:31:16 pm
Whoa boys.

I'm on the road today and may not be reading very carefully but the sense I'm getting is you want to bypass the stringent filtration process and just let people nominate their favorite program. No. No explicit voting either. This approach completely misunderstands why we have a Programs board in the first place. That is the arena where are things are decided. Let me remind too that any code that ends up on our curated boards must pass through Programs first.

Taking Terry's list as an example, I'd say probably 90% of it is polished and ready. And suddenly we have to choose one? Nope. This isnt a place where we should feel overwhelmed by some coders being more prolific than others. We arent here to be fair to the members, we are being fair to the readers. Let's offer only the best.

@STxAxTIC

OK but then I strongly recommend putting the new Games board as another Child Board of Samples.

Maybe Toolbox too, what is dividing line between Informatics and Toolbox item? Don't say STxAxTIC ;-))
Title: Re: Samples Gallery
Post by: STxAxTIC on March 02, 2020, 03:18:20 pm
I admit the theory of category hasn't been fully worked out yet, but theres something that differentiates games from other works, namely there is a clear target as to when its complete. That, and not all games present well as a Zip. Soon, there will hopefully be references to, but not explicit hosting of, well-established games that have gotten too big for us. That's why it's not a child group at the moment.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 02, 2020, 06:13:17 pm
Quote
Maybe Toolbox too, what is dividing line between Informatics and Toolbox item? Don't say STxAxTIC ;-))

LOL

Nah, so Toolbox as-is may or may not survive this whole thing, but for now I still think it's mission is well-stated and it sits right where it should be. 'Cause again: the toolbox is supposed to contain very tight, mostly parameter-free code that someone can just CTRL+V right into their program. In other words, if the method is more important than the thing being shown, it may be a Tool (formally).

Informatics as a section will make more sense when we open up a Math/Geometry child board as its brother. For instance, the line-intersecting-ellipse-and-all-that stuff we work on from time to time .... is that really a tool? Is it a 2D sample? Nah nah nah - its something else. Sometimes the code is about the applied math and zilch about how we show it.... that's where my head's at.
Title: Re: Samples Gallery
Post by: Qwerkey on March 03, 2020, 04:10:13 am
I think that Games is good as a separate board.  It could even have Child Folders for different types of Games?  (Depends how large that board will become).  We, as ever, will discover how The Librarian wants to do it.
Title: Re: Samples Gallery
Post by: Qwerkey on March 03, 2020, 09:30:50 am
I have added Terry Ritchie's InForm Calulator to the Samples Gallery.  This program has a number of factors which get it placed there:

i)  It is an excellent piece of coding and a really good working program
ii) It is by a highly gifted member
iii) It is an excellent advert for QB64 AND for InForm
iv) It has good descriptions in the code

I'm not, of course, going to comment upon every posting I put into Samples, but give here my selection criteria.
Title: Re: Samples Gallery
Post by: Qwerkey on March 03, 2020, 09:36:44 am
@Ashish Here is a screenshot of your Samples Program.  It runs on my machine without sky rendering.  Odd.
Title: Re: Samples Gallery
Post by: FellippeHeitor on March 03, 2020, 10:19:41 am
I have added Terry Ritchie's InForm Calulator to the Samples Gallery.  This program has a number of factors which get it placed there:

i)  It is an excellent piece of coding and a really good working program
ii) It is by a highly gifted member
iii) It is an excellent advert for QB64 AND for InForm
iv) It has good descriptions in the code

I'm not, of course, going to comment upon every posting I put into Samples, but give here my selection criteria.

For InForm samples it might be wise to attach the original zip as the author shared it, since it'll pack the library version the author originally used when coding the sample.
Title: Re: Samples Gallery
Post by: Qwerkey on March 03, 2020, 10:33:32 am
@FellippeHeitor Good idea.  I was wondering how InForm-inexperienced persons would cope.
Title: Re: Samples Gallery
Post by: Qwerkey on March 03, 2020, 12:24:10 pm
@bplus For entries into the Samples Gallery by STxAxTIC's convention, the title of the post contains the creator's name.  For the entry which you created, you had the title "Draw Spinners", and I have amended that to "Draw Spinners by bplus".  Once we both get used to doing this, this sort of thing will come naturally.
Title: Re: Samples Gallery
Post by: bplus on March 03, 2020, 12:35:20 pm
OK, I did not notice the title "by author" before thanks for pointing that out Qwerkey.
Title: Re: Samples Gallery
Post by: Ashish on March 04, 2020, 02:29:31 am
@Qwerkey It is working fine on my machine. All sky rendering is proper. But still, I am going to investigate this.
Title: Re: Samples Gallery
Post by: Qwerkey on March 04, 2020, 06:07:55 am
@bplus, I'd like to add your Dropping Balls program https://www.qb64.org/forum/index.php?topic=194.0 (https://www.qb64.org/forum/index.php?topic=194.0) to Samples Gallery (2D/3D Graphics without SUB _GL).  It has very good graphics and the whole post is a good demonstration of collaborative work between various members.  There is quite a bit of amazing stuff in that post.  I want to use the code of « Reply #4 on: April 03, 2018, 05:39:05 PM » in Samples.  That code could do with a bit of tidying up (and perhaps a few more explanatory comments).  Would you be able to do that before I add to Samples?  Thanks, Qwerkey
Title: Re: Samples Gallery
Post by: Ashish on March 04, 2020, 09:48:44 am
@Qwerkey Is night sky is also not appearing in your system? Which version of QB64 are you using? How much is your RAM and VRAM?
Title: Re: Samples Gallery
Post by: Qwerkey on March 04, 2020, 10:42:16 am
@Ashish I didn't know that night sky was an option - I thought that there would always be blue sky + clouds behind the terrain.  One idiot user, I think.  Pay no more attention to it.
Title: Re: Samples Gallery
Post by: bplus on March 04, 2020, 11:06:48 am
@bplus, I'd like to add your Dropping Balls program https://www.qb64.org/forum/index.php?topic=194.0 (https://www.qb64.org/forum/index.php?topic=194.0) to Samples Gallery (2D/3D Graphics without SUB _GL).  It has very good graphics and the whole post is a good demonstration of collaborative work between various members.  There is quite a bit of amazing stuff in that post.  I want to use the code of « Reply #4 on: April 03, 2018, 05:39:05 PM » in Samples.  That code could do with a bit of tidying up (and perhaps a few more explanatory comments).  Would you be able to do that before I add to Samples?  Thanks, Qwerkey

Interesting choice, my personal favorite is the one before with sound where the physics isn't so wacky. But I can see how building the pyramid shape can be appealing specially the perfect "racks" that come and go increasingly larger but the balls act so strange, magnetic?  OK maybe that's being +  ;-))

Thanks for your interest, Qwerkey, I look forward to collaborating with you for a good sample. That was a fun thread!
Title: Re: Samples Gallery
Post by: _vince on March 04, 2020, 11:26:22 am
It was a fun thread, even though you and static totally dropped the ball on the physics!
Title: Re: Samples Gallery
Post by: bplus on March 04, 2020, 11:35:16 am
It was a fun thread, even though you and static totally dropped the ball on the physics!

:-)) Call it: Rebounding Science Fiction

Better not drag static into this, it was I who (mis)used a snippet for ball handling which helped make those "rack" formations more perfect more often.
Title: Re: Samples Gallery
Post by: Qwerkey on March 05, 2020, 06:35:03 am
@bplus Do you want to join Discord?  There's a lot of stuff to do with QB64 in general and sometimes Library in particular.  You do not have to (I've got it covered).
Title: Re: Samples Gallery
Post by: FellippeHeitor on March 05, 2020, 06:41:33 am
@bplus Do you want to join Discord?  There's a lot of stuff to do with QB64 in general and sometimes Library in particular.  You do not have to (I've got it covered).

Everyone should.
Title: Re: Samples Gallery
Post by: Qwerkey on March 05, 2020, 06:49:46 am
Too Much Qwerkey.  You can have too much of a good thing.  I've just noticed that at this moment Qwerkey has the last post of the first 4 Sections.  That's far too much of him! (I would have put this silly remark in Off-Topic, but you can't do attachments there).

Title: Re: Samples Gallery
Post by: bplus on March 05, 2020, 11:38:39 am
Too Much Qwerkey.  You can have too much of a good thing.  I've just noticed that at this moment Qwerkey has the last post of the first 4 Sections.  That's far too much of him! (I would have put this silly remark in Off-Topic, but you can't do attachments there).

Ah first time as librarian at SmallBASIC, I was going to do all kinds of updating of outmoded code. Did not work out too well, you need the author around to fix up and maintain the spirit of the thing. Here that is still possible, thank goodness.

There should be lots of low hanging fruit, so picks should be ripe and juicy. I suggest you bump the threads of interest and query authors as you did with me, I appreciated chance to go back and improve things a bit. Might let things cook for others comments too, maybe at least a week cool off time? There's no hurry, the quality stuff will still be quality stuff months from now.

You will evolve your own system I'm sure.
Title: Re: Samples Gallery
Post by: bplus on March 05, 2020, 11:54:37 am
@bplus Do you want to join Discord?  There's a lot of stuff to do with QB64 in general and sometimes Library in particular.  You do not have to (I've got it covered).

Not at this time thank you. I am liking this thread at present.

Everyone should.

This kind of argument never appealed to me. Everyone told me I didn't need to study for my temporary driver's license, result: no B+
Title: Re: Samples Gallery
Post by: Qwerkey on March 05, 2020, 12:22:58 pm
To Library Staff:
I attach a document of my WIP for information.  Following Fellippe's recommendation I am going through the existing projects sorted on number of Views.  When we have a reasonable (but small) number of Samples, we can look at Games (& Toolbox) and then start on the member applications which The Librarian will own (and farm out as necessary).  I'll replace this document here as I go along.  7/3/20 Updated below.
Title: Re: Samples Gallery
Post by: bplus on March 05, 2020, 03:43:12 pm
@Qwerkey these are my thoughts skimming over your WIP list.

OMG Pig and Snake! there are so many better games, proves that you can't go by either replies or views. These are fun learning threads. Prithak's interesting and pretty sure Cobalt has something special just completed (so he says) and MasterGy... did we see source? I don't know "real" games so well, I go by screen shots.

Replies to Starfield are all over the place too, another fun thread! but was there any one attraction, maybe RotoZoom or maybe Sphere mapping to make planets? Maybe just Star Trek fans, they might like Old Moses game if he knows when to quit and can get there.

Sprite Library, Game Maker, qXed are very interesting tools or Infomatics (I am leaning towards libraries for Infomatics) but wait and see if others start using them including their authors.

B+ Pathfinder was just a study but very helpful for me in preparation for PaintImage or was it Painting like functionality and either Escape from Monster Maze or running a psychic mouse through a maze.

Petr 3D _MAPTRIANGLE is it done? I got impression he is a bit overwhelmed by this project and has to work for a living. It was pretty cool as far as he had gotten.

     Update: Ah Sprite Editor, forgot about that, seems project got stuck trying to load files. I tried Steves Load File thing and it works in simple app tester but anything more complicated it dies.

@ Fellippe Does Inform have a File Selecting Dialog?
Title: Re: Samples Gallery
Post by: _vince on March 05, 2020, 04:48:28 pm
Better not drag static into this, it was I who (mis)used a snippet for ball handling which helped make those "rack" formations more perfect more often.

was there an a original program that was posted by the expert ball handler himself from which you based yours on?
Title: Re: Samples Gallery
Post by: bplus on March 05, 2020, 05:24:13 pm
was there an a original program that was posted by the expert ball handler himself from which you based yours on?

My ball collision code starts back with SmallBASIC, at Walter's or [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] I posted some translation and somewhere along the line STxAxTIC offered advice about how to keep balls from overlapping. That advice might have come from from some code he had worked up from some other time and place.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 05, 2020, 06:37:26 pm
This thread is just hoppin' you guys! I praise everyone's energy. Qwerkey, you're killing it out there - don't change a thing about your style. The more sediment we can kick up and feathers we can ruffle, the better. Pretty soon Steve should be back in the picture and we can assimilate whatever of his works he points us to.

As for the big tasks on hand, I'd say let's get as much of Terry's finished code up there as we possibly can. I'll even try some tonight but this is a tall order.

And we're on the verge of opening a new category related to computation and algorithm. This will be the kind of thread where the method being shown is way more important than the vehicle that brings it. Case in point: pathfinding. So many programs need it. I don't care if Pacman is the example. See where I'm at on that? Another bucket of contributions for this thread would be all the intersection stuff bplus and others were working on, including collision detection. So stay tuned for that too...

Alright, will chime in as things come to mind. Keep up the grinding boys!

EDIT

Also Articles - and why we might need two categories of *those*...
Title: Re: Samples Gallery
Post by: Qwerkey on March 06, 2020, 04:45:43 am
@bplus Thanks for checking through the ToDo list.  Being on the list does not, of course, automatically qualify for entry.  Your categorisations will enable me to immediately make some of the blank ones N/A, and I can move onwards.  This is good teamwork.
Title: Re: Samples Gallery
Post by: Qwerkey on March 06, 2020, 04:50:40 am
@STxAxTIC Will carry on as instructed, Sir!  Our visibility in effort here is generating interest from our prolific members.  Expect applications coming your way.  Farm out any you want to me and they'll be done.  Kudos for Team Library.
Title: Re: Samples Gallery
Post by: SMcNeill on March 06, 2020, 07:57:36 am
STx mentioned me pointing you guys toward some of my works; here’s one which you might stick in there somewhere, which I just shared elsewhere for Terry:   https://www.qb64.org/forum/index.php?topic=2042.0

Not everyone is going to need an independent, programmable, keyboard routine, but for those who do, I imagine the above will handle all their needs handily.  ;)
Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 10:18:58 am
STx mentioned me pointing you guys toward some of my works; here’s one which you might stick in there somewhere, which I just shared elsewhere for Terry:   https://www.qb64.org/forum/index.php?topic=2042.0

Not everyone is going to need an independent, programmable, keyboard routine, but for those who do, I imagine the above will handle all their needs handily.  ;)

@SMcNeill

I would like to help you with this, your link points to a thread whose best answer points to a reply that is labeled:
Quote
Added a few helper functions to the programmable keyboard routines above.

I don't think that is main tool, and I think we are talking tool here. It looks as if RhoSigma has tested and did @TerryRitchie  find it helpful? @TempodiBasic seems happy.

Could you bump thread with description and final code version or code link you'd like to see added?
Do you think an instruction manual might be needed to go along with this? To me it looks like we are customizing keyboards for different countries? Ha, maybe the whole thread IS the manual. :)

Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 11:45:25 am
@STxAxTIC  @Qwerkey

I need help with list of Tag labels, I don't think I can just make 'em up as I go...

Is [Retro] [Sim] OK? for TerryRichies 1980's Simon replica.

Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 02:17:29 pm
@FellippeHeitor 

Does "Lights On" in Games Board look OK to you? I couldn't find the post here but had a copy saved from before ([abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] ?) and found your reference in Dav's version. I like the game and to me it offers model example of game package (like Terry's) nice details of sound and help... and miraculously the zip fit!
Title: Re: Samples Gallery
Post by: FellippeHeitor on March 06, 2020, 02:24:14 pm
All good! Thanks for adding it.

PS: Might want to "insert attachment" in gallery posts, so the screenshots become part of the post (inline).
Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 03:29:26 pm
All good! Thanks for adding it.

PS: Might want to "insert attachment" in gallery posts, so the screenshots become part of the post (inline).

Thanks, and done.
Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 05:31:41 pm
@SMcNeill

I would like to help you with this, your link points to a thread whose best answer points to a reply that is labeled:
I don't think that is main tool, and I think we are talking tool here. It looks as if RhoSigma has tested and did @TerryRitchie  find it helpful? @TempodiBasic seems happy.

Could you bump thread with description and final code version or code link you'd like to see added?
Do you think an instruction manual might be needed to go along with this? To me it looks like we are customizing keyboards for different countries? Ha, maybe the whole thread IS the manual. :)

Still digesting this, but it does look like the Best Answer was pointed right.
Not sure how one goes about decoding key numbers for use in code. It's interesting that Mouse clicks can be detected also, and how is that decoded for use in code?



Title: Re: Samples Gallery
Post by: SMcNeill on March 06, 2020, 06:28:57 pm
Still digesting this, but it does look like the Best Answer was pointed right.
Not sure how one goes about decoding key numbers for use in code. It's interesting that Mouse clicks can be detected also, and how is that decoded for use in code?

If you run it, you’ll see that I tried to map the keys to match the KEYHIT codes for a standard US Keyboard, as much as possible, so you can use those values for primary reference. 

Now, some keys aren’t mapped to KEYHIT codes, simply because there’s no default KEYHIT value for them.  (Such as the PLAY, BACK, FORWARD, or STOP buttons on keyboards that have those extra keys.)  *ANY* key that Microsoft can read from a specialized keyboard should be able to be read by the program — and I gave them a default value of starting with 900000+.  If you look at the DATA statements, you can tell from them which keys they should normally map to:

Code: [Select]
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 176,900176,0,0,0,0,0.2: 'Media Next
    DATA 177,900177,0,0,0,0,0.2: 'Media prev
    DATA 178,900178,0,0,0,0,0.2: 'Media stop
    DATA 179,900179,0,0,0,0,0.2: 'Media Play/Pause
    DATA 180,900180,0,0,0,0,0.2: 'Launch mail
    DATA 181,900181,0,0,0,0,0.2: 'Launch media select
    DATA 182,900182,0,0,0,0,0.2: 'Launch app1
    DATA 183,900183,0,0,0,0,0.2: 'Launch app2

Media Play/Pause button will return a default value of 900179.  Next button is default 900176.  If your keyboard has a MAIL button, its value will be 900180.  (Unless you remap those values for your own needs/keyboards, which might be different according to your region/language, that is...)



Now, some keyboards have a mouse built in, and as such, we detect mouse buttons as extended input events as well.   (Values around 900005, or so, if I remember correctly.)

If you wanted to, you could use the input routine to either accept, or ignore those extended key events:

k = KEYHIT
SELECT CASE k
    CASE < 0 ‘keyup event
    CASE < 27 ‘CTRL-CHARACTER event... also tab, backspace, enter, a few others fall into this range.
    CASE > 900000 ‘Extended, non-keyhit codes for buttons QB64 doesn’t usually detect.
    CASE ELSE ‘The rest of the stand QB64 KEYHIT codes
END SELECT



The advantage to a completely customizable keyboard routine like this, is like TempodiBasic illustrated: Remapping of keycodes to support international keyboards.

AltGr-E in italian produces an accented “e”...  _KEYHIT doesn’t support that, but with his language modification, KEYHIT (the library sub of very similar name) does.


Code: [Select]
             Remap_KeyCode 191, 151, 0, 21, 0, 0, 0.2: '£ 
            Remap_KeyCode 222, 133, 0, 248, 0, 35, 0.2: '… ø#
            Remap_KeyCode 192, 149, 0, 128, 0, 64, 0.2: '• € @
            Remap_KeyCode 186, 138, 0, 130, 0, 91, 0.2 'Š ‚ [

(The above is an excerpt from Tempodi’s remapping to allow non-US, and non-QB64 supported, characters to be read and displayed properly with his Italian keyboard.)


Customizable keycodes...

Set them to whatever you need to support your program, language, and keyboard.  ;D
Title: Re: Samples Gallery
Post by: STxAxTIC on March 06, 2020, 07:23:24 pm
@STxAxTIC  @Qwerkey

I need help with list of Tag labels, I don't think I can just make 'em up as I go...

Is [Retro] [Sim] OK? for TerryRichies 1980's Simon replica.

Don't worry for now @bplus - when there are enough entries I'll sweep through and unify all of them. I've made only a half-ass attempt at this so there's barely a pattern other than that I list them in ABC order. Just do what feels right - this will be smoothed over later.
Title: Re: Samples Gallery
Post by: bplus on March 06, 2020, 07:40:28 pm
Qwick note to @Qwerkey, looking over your WIP list again, did you know STxAxTIC has already posted to Library Toolbox the ellipse stuff way back when it was the only thing in there for months!, another blank box to check off.
Title: Re: Samples Gallery
Post by: Qwerkey on March 07, 2020, 04:38:35 am
@bplus Yes thanks, I had noticed that.  My first WIP list was rather hastily put together and some of the Actions not properly filled in.  I need all the help I can get.  You're doing an excellent job with what you're up to.  I mean to do a second page of by Views trawl, and then I'll help with what you're doing if I can.  Our Master seems to be pleased with our efforts.  I foresee a charabanc outing for Library Staff.
Title: Re: Samples Gallery
Post by: Qwerkey on March 07, 2020, 05:48:06 am
Updated Trawl WIP.  Now with page 2 of by Views.  Also including InForm projects, given in red.  This list in by Views order depends upon how long a project has been on the site.  So after page 2 of this list we will revert to entry into Samples/Games by submission.

@bplus If you have time, would give the list a going over?  You were involved with many of the projects and are able to cast a more expert view.  Thanks.
 [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Samples Gallery
Post by: Qwerkey on March 07, 2020, 07:36:58 am
@bplus I have got down to another of your projects, Battleships https://www.qb64.org/forum/index.php?topic=218.0 (https://www.qb64.org/forum/index.php?topic=218.0).  This looks to be another for Games.  In the posting, you have a zip file for version5, but data for version 6.  I could not find code for version 6: probably my stupidity.
Title: Re: Samples Gallery
Post by: bplus on March 07, 2020, 11:21:58 am
@bplus I have got down to another of your projects, Battleships https://www.qb64.org/forum/index.php?topic=218.0 (https://www.qb64.org/forum/index.php?topic=218.0).  This looks to be another for Games.  In the posting, you have a zip file for verion5, but data for version 6.  I could not find code for version 6: probably my stupidity.

That was a cool game Johnno helped with assets and AI quips to player, I studied shelling strategies for AI to play against human. It's been awhile as I recall version #5 was state of art of The Game as I remember and then I started AI versus AI for data on those shelling strategies. Cobalt, I think, later came up with exact replica of the physical game.
Title: Re: Samples Gallery
Post by: bplus on March 07, 2020, 12:47:29 pm
@Qwerkey I'd really like to put something up of yours because I think you are too humble to self promote. I like Pie in the Sky wonderfully fanciful (R Frost has one too but his latest?? I have 2 older versions that seem to work better for me) , your Crosswords, your Cuckoo Clock (is that here at this forum?), and why did your rule out Trackword? isn't there something there that we could flag that thread like we did with Dropping Balls. Mahjong has something slightly off the way tiles stack that is confusing but beautiful tiles and setup. Duck shoot very well put together but I am not into shooter games, need a shooter game aficionado for 2nd on that .

Speaking of shooter games, cross off eRATication which is a sort of over the top shooting spree spoof complete with blood shed that appeals to dark side that I don't want to promote. Just playing around, but you have to wonder why so many versions? eeeh...

Some thoughts of other items:
Lissajous by Fellippe jumps out at me, yeah! cool one. (I am graphics in motion guy.)

Mega Sensa - makes no sensa to me except Steve McNeill came up with a really cool way to list permutations, an unGodly amount of them, so many that he came up with way to stop and pickup where the execution of list left off from last run in next run. That may be worth the price of admission.

Starfield background - did have something there about making realistic looking planets rotating while cruising around in space. But did anyone else like that (besides it's author)?

Sprite Editor - hit a big stall not being able to load files, a decent directory and files loader thing that works on Linux. Everyone says try Steve's code thing that I have working in a test sample demo but flops when I try to add that code to something big and complicated could be my fault (usually is) but in meantime has anyone else gotten SMcNeill's files and directory thing to work for them in Linux? (I am just a Windows user.) Oh, @TerryRitchie might have something to help get things connected smoothly? That seems a really needed tool for us at QB64. I have got to try that demo code in other easier apps but I have stared to avoid file loading situations. I mean my thing for Windows works fine easy to understand and mod but I like to include Johnno and Linux fans in QB64 fun.

more update:
Lander project ended with criticism it was too dark, maybe so I thought I was adding to difficulty and "realism" (ha! more sci fi)

Oh the split and join thing was a "collaboration" and that should be the author for that, I am just the dog who kept following it up with tiny improvements, same goes for Rotozoom3. Now that I see STxAxTIC's wonderful word for this blpus is going to make some edits to author for these. Qwerkey you can check that box as added already.
Title: Re: Samples Gallery
Post by: Qwerkey on March 07, 2020, 01:10:15 pm
@bplus Thanks for looking into the list, you are always so involved with everything that your views are sure to be good.  Fellippe's Lissajous I've put on the ToDo list.  As for my stuff, we just haven't got down that far yet.  I know you like Pie-in-the-Sky (you were very complimentary in the post) and it was great fun to code.  But it does lack purpose.  I'm not so keen on it to go into Samples: there is one thing in its favour, though: it uses _MEM processing *.  Duck Shoot very obscure and not much utilised, not to go in Games.  Crossword Generator is just too narrow in its appeal.  Cuckoo Clock is just another clock.  I favour Mahjongg myself.  It shows off InForm in a game that many will be familiar with (it plays exactly the same as Microsoft's version).  I am proud of my creations, but many are probably not Samples/Games material.  The clue is in my site name.  I like to be quirky, so maybe not always what is desired.
* I remember that you created a graphics program using _MEM with very nice output.  We should use that.
Title: Re: Samples Gallery
Post by: bplus on March 07, 2020, 01:15:50 pm
@Qwerkey
Added a couple more updates in post above, man we have such different views, I knew you would go humble on me ;-))
wait...
Quote
(it plays exactly the same as Microsoft's version)
I have to check this out and review Mahjong again, am I missing something?
Title: Re: Samples Gallery
Post by: bplus on March 07, 2020, 01:52:26 pm
@Qwerkey

Quote
there is one thing in its favour, though: it uses _MEM processing *.

Also in it's favor is the variety of graphics you demo unlike R Frost yours demo are more modern image manipulation techniques as opposed R Frost sampler from past Basic Classic's, hand draw stuff which I like too. Purpose!?!? Isn't the pursuit of happiness enough?!?

I can't find the link to the Split and Join thread in your WIP list, maybe past lunch and my sugar getting low, search engine goes absolute blank to Split and join keywords???? It should be the one to link to instead of STxAxTIC's link to my submission request for Split1000 because it has the complementary Join and shows whole discussion.

PS Battleship 5-AI is it, version 6 was AI vrs AI for stats and is stripped down version for speed and other experiments.
Title: Re: Samples Gallery
Post by: Qwerkey on March 08, 2020, 06:35:58 am
@bplus For the RotoZoom3 (Modification) Sample, you forgot to put the Author in the title again (this must be your modesty).
Title: Re: Samples Gallery
Post by: Qwerkey on March 08, 2020, 06:45:28 am
@bplus I've just had a look through my QB64 Projects catalogue, and there are some that I might like for consideration (eg Scrabble, I thought was reasonable, and I know that Steve, Mr Wordsmith, played it).  There is no hurry to put my stuff in, anyway.  At present I am sure that Steve is way under-represented so we must root out all his worthy stuff.
Title: Re: Samples Gallery
Post by: Qwerkey on March 08, 2020, 07:56:25 am
@bplus The board SUB _GL is somewhat underpopulated at present.  We can ask Ashish to dig out some more of his stuff, and if we can get hold of Unseen Machine he has done work there (I think).  But I was looking at Galleon's 3d_model_viewer in /programs/samples/open_GL.  That's a really ggod demo of what Open GL can do.  Of course, it is already supplied with QB64 instal, but do you think that it would be a good idea to put it in Samples Gallery as well?
Title: Re: Samples Gallery
Post by: bplus on March 08, 2020, 08:40:42 am
@bplus For the RotoZoom3 (Modification) Sample, you forgot to put the Author in the title again (this must be your modesty).

Sorry, I was confused because I was definitely NOT the author of original RotoZoom, Galleon was but I am author of it's Modification. Ha I thought I solved the Author business in Title by just labeling it a Modification.

Did you notice STxAxTIC himself has skipped the "by Author" business in Titles for the Math & Geometry Board? And he was labeling Titles with "Collaboration" but they seemed to have disappeared since the assimilation of the Toolbox.

To me, "Modification" nailed it but I do want to be consistent with you so it's changed.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 08, 2020, 08:53:52 am
Did you notice STxAxTIC himself has skipped the "by Author" business in Titles for the Math & Geometry Board? And he was labeling Titles with "Collaboration" but they seemed to have disappeared since the assimilation of the Toolbox.

Yeah ya know what? I had kindof a thought about this and I might stay on it, or might dismiss it. The thought is:

Programming is half creation and half discovery. People who create truly unique and quirky code are probably the creative type, whereas people who want things to be more systematic and mathematical are on the path of discovery, not creation. Exhibit two is, all of the relevant mathematics (to us) has already been invented by someone else a few hundred years ago, so it sounds weird to credit one of *us* for coding up, whatever, Newton's method. I would be embarrassed if anyone thought I actually invented much of the math I use - I consider it better to not attach any forum member's name to a mathematical algorithm unless they truly invented it.

Games, software clones, etc etc - are completely different. These kinds of entries will feature the author in the title.

Make enough sense?
Title: Re: Samples Gallery
Post by: bplus on March 08, 2020, 08:58:58 am
@bplus I've just had a look through my QB64 Projects catalogue, and there are some that I might like for consideration (eg Scrabble, I thought was reasonable, and I know that Steve, Mr Wordsmith, played it).  There is no hurry to put my stuff in, anyway.  At present I am sure that Steve is way under-represented so we must root out all his worthy stuff.

Scrabble sounds great! is that in this forum? (I am thinking NOT.)  If not, bring it in under programs for potential cooking unless you think it cooked enough at [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there].

Pie-In-Sky, I started looking over with more critical eye 1600+ line main program! ha, hah, you hardly use procedures still it's a delight to watch.

Crosswords, IMO, begs for clues so you have a game of it, seems to me the hard part is done (just glancing over screen shot on that) but you have nice number of views and replies on that one.

Haven't gotten to Mahjong yet but I am working.

Re: Steve, man that keyboard customize thing has me stumped maybe overthinking just throw the SUB in Samples and point to thread for the "manual" and further inquiries.
Title: Re: Samples Gallery
Post by: Qwerkey on March 08, 2020, 09:02:13 am
Did you notice STxAxTIC himself has skipped the "by Author" business in Titles for the Math & Geometry Board? And he was labeling Titles with "Collaboration" but they seemed to have disappeared since the assimilation of the Toolbox.
@bplus When the Toolbox was separate, STxAxTIC did not have authorship in the title there, for reasons he says, so when he moved them back into Samples they didn't obey "the rule".  Sorry, I am such a stickler for conventions!
Title: Re: Samples Gallery
Post by: bplus on March 08, 2020, 09:15:20 am
@bplus When the Toolbox was separate, STxAxTIC did not have authorship in the title there, for reasons he says, so when he moved them back into Samples they didn't obey "the rule".  Sorry, I am such a stickler for conventions!

For Games and Graphics yeah, authors in title make total sense, specially when there is so many versions or clones. Calculators or Clocks it's definitely the author that makes them unique.
 
For RotoZoom3 I assume is OK with you guys both now? I am OK with Modification by bplus but the real author is mainly and by far Galleon and I hope to flag attention to this image tool.
Title: Re: Samples Gallery
Post by: bplus on March 08, 2020, 09:21:24 am
@bplus The board SUB _GL is somewhat underpopulated at present.  We can ask Ashish to dig out some more of his stuff, and if we can get hold of Unseen Machine he has done work there (I think).  But I was looking at Galleon's 3d_model_viewer in /programs/samples/open_GL.  That's a really ggod demo of what Open GL can do.  Of course, it is already supplied with QB64 instal, but do you think that it would be a good idea to put it in Samples Gallery as well?

I have collected a number of Ashish demos and until other people start using Open _GL these would be good demos to get folks started, they are nice attention grabbers and fairly brief in lines of code.

of course, Galleon's examples are more than fine with me!
Title: Re: Samples Gallery
Post by: SMcNeill on March 08, 2020, 10:09:12 am
@bplus I've just had a look through my QB64 Projects catalogue, and there are some that I might like for consideration (eg Scrabble, I thought was reasonable, and I know that Steve, Mr Wordsmith, played it).  There is no hurry to put my stuff in, anyway.  At present I am sure that Steve is way under-represented so we must root out all his worthy stuff.

I’ve just been wrapped up with life in general here lately, and haven’t been around much, so don’t feel any rush to put anything of mine up urgently — I don’t know when I’d have time to address any questions/concerns you guys might have with them.  Hopefully things will settle down by next month, and the wife will be back home from her extended hospital/rehab stay, and I’ll have time to help sort out a few things of mine to help you put them into Samples.

Some projects which I can think of off the top of my head would probably be:

SBott — the demo IRC chat bot, which tons of people have used as a base to play around with creating bots in the #QB64 channel.

The Screen 0 Newsfeed Clock, as it highlights how to download RSS feeds, parse them, and use them in a program.

My little picture tile game from waaay back when (and I don’t even remember the name of it, now), as it highlights the old GET/PUT method of storing images in arrays and moving them, rather than _PUTIMAGE or _MEM.  It might be useful for folks studying QB45 style commands.  (Was the game called SHUFFLE?  Something similar?)

Ummm...  And those are the only things which pop up off the top of my head, without me digging and looking around more myself.  Heck, I’m not even 100% certain what’s been added/archived already fully, as I’ve just been browsing things and skimming over topics/posts here a lot lately.  /blush

Hopefully, life will settle back down here soon, and then I can start devoting some extra time to the forums (and coding in general) once again.  ;D


Title: Re: Samples Gallery
Post by: SMcNeill on March 08, 2020, 10:26:36 am
Re: Steve, man that keyboard customize thing has me stumped maybe overthinking just throw the SUB in Samples and point to thread for the "manual" and further inquiries.

If you want my thoughts on it, I’d suggest you guys make a LIBRARY subsection in samples, and use it to highlight those extended toolsets that people create which might need extended information, and give the authors highlighted there edit/mod rights so they can update/correct things as needed.

Some quick library collections which could be added to that section might be:
Terry Ritchie’s Menu, GLInput, Button, Sprite libraries.
RhoSigma’s various libraries from his signature.
DarthWho’s various graphic/game engine libraries.
I’ve got several (I just need to share and document them better when I have time), such as Text libraries, Image libraries, the keyboard library....

Libraries are like Tools, except they’re the much more complex version of them.   SaveBMP would qualify as a simple tool to save a screen image as a BMP file.  The SaveImage Library does that *PLUS* PNG, GIF, JPG, screen 0 conversions, 32-bit to 256 color conversions/dithering, and more!

It’s a lot more work to upkeep, improve, and maintain a library than it is just a singular tool, so it’d be nice if the library creators could have rights to edit their own stuff, but it’d also be nice just to have a place to highlight these extended toolsets so they don’t get lost in the ether somewhere...
Title: Re: Samples Gallery
Post by: Ashish on March 08, 2020, 10:47:35 am
@Qwerkey @bplus
If you interested for adding SUB_GL programs then please have a look at - https://github.com/AshishKingdom/QB64_OpenGL_Demos
It contain a total of 35 demos. Some are coded by @Petr and some are by me.
Title: Re: Samples Gallery
Post by: bplus on March 08, 2020, 11:33:01 am
@Qwerkey @bplus
If you interested for adding SUB_GL programs then please have a look at - https://github.com/AshishKingdom/QB64_OpenGL_Demos
It contain a total of 35 demos. Some are coded by @Petr and some are by me.

Thanks Ashish, looks like a vein of gold here, including Petr's. Do you happen to have links back to QB64 forum posts in those? What ones are your favorites for fun, cool effect or instruction?
Title: Re: Samples Gallery
Post by: Qwerkey on March 08, 2020, 01:41:02 pm
@bplus I know that you have already played Scra88le (mustn't use the copyrighted trade name!), so you don't need to spend more of your time on it (where do you find all the time from?).  It is in Programs here. https://www.qb64.org/forum/index.php?topic=344.msg2323#new (https://www.qb64.org/forum/index.php?topic=344.msg2323#new)
Title: Re: Samples Gallery
Post by: TerryRitchie on March 08, 2020, 02:09:44 pm
If you want my thoughts on it, I’d suggest you guys make a LIBRARY subsection in samples, and use it to highlight those extended toolsets that people create which might need extended information, and give the authors highlighted there edit/mod rights so they can update/correct things as needed.

Some quick library collections which could be added to that section might be:
Terry Ritchie’s Menu, GLInput, Button, Sprite libraries.
RhoSigma’s various libraries from his signature.
DarthWho’s various graphic/game engine libraries.
I’ve got several (I just need to share and document them better when I have time), such as Text libraries, Image libraries, the keyboard library....

Libraries are like Tools, except they’re the much more complex version of them.   SaveBMP would qualify as a simple tool to save a screen image as a BMP file.  The SaveImage Library does that *PLUS* PNG, GIF, JPG, screen 0 conversions, 32-bit to 256 color conversions/dithering, and more!

It’s a lot more work to upkeep, improve, and maintain a library than it is just a singular tool, so it’d be nice if the library creators could have rights to edit their own stuff, but it’d also be nice just to have a place to highlight these extended toolsets so they don’t get lost in the ether somewhere...

Excellent idea Steve. I would like to see this too if possible.
Title: Re: Samples Gallery
Post by: STxAxTIC on March 08, 2020, 02:18:15 pm
All in due time, boys, but here's the thing. Code libraries are the wild west. These must go through the same vetting and scrutiny as everything else the ends up in a Library - because if we don't do that, our curated sections just become wild again and we'd be just asking a new layer of separation down the road to differentiate the good from the crappy.

If you agree with that, you can see there's absolutely no way we're going to hybridize the current admissions process. It's been asked and discussed countless times whether we should have a version of the forums where the original author can moderate or lock out responses in a thread they created. It was decided NO, we will have a strict Library section, and also a wild Programs section. We won't be making an army of Walts out of everyone here. Can't you already see the parallel discussions? Someone here is gonna say "Over in Programs they're talking smack about my code. But here on my thread, where I rule, every so-called 'bug' is a feature!" Literally over my dead body will we have this dynamic here.

If code tends to be updated a lot, and it would be convenient for the author to not have confused versions out there, well... that's kindof on you. Either keep it in Programs - in which case the Librarians will *naturally* assimilate the updates because the post will be current - or even better - make the homepage for your project correspond to the URL at the top of its library entry. You will start to see more and more projects link to github as its URL for this reason. If the Librarian falls behind, bump the topic in Programs. Everyone see what I'm going for here? One channel, one method. When the code starts to fade into last week in the Programs board, the Librarians swoop in. The Library does not feature anyone's dirty builds.

Before I end this endless rant I point this out too: just because something is *sometimes* useful, does not mean it needs to be included in the presented product. We can have as many variations on pac man or minesweeper as we want, I don't care. BUT when it comes to reference code and teaching tools, I think we should be more conservative.
Title: Re: Samples Gallery
Post by: TempodiBasic on March 08, 2020, 04:04:03 pm
HI
what do you think about this interpreter?

It is projected by Larry, the fix is mine.
He may post the final working version.
Title: Re: Samples Gallery
Post by: TempodiBasic on March 08, 2020, 04:12:53 pm
Moreover I like these
by Terrie Ritchie
Title: Re: Samples Gallery
Post by: TempodiBasic on March 08, 2020, 05:04:57 pm
In my repository I find so many good programs, maybe some of these are on the [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] so I post some here and you can evaluate them. Maybe you find someone good enough to enter in sample gallery.
Title: Re: Samples Gallery
Post by: Ashish on March 09, 2020, 01:30:09 am
Thanks Ashish, looks like a vein of gold here, including Petr's. Do you happen to have links back to QB64 forum posts in those? What ones are your favorites for fun, cool effect or instruction?

@bplus
These are some cool demos of SUB_GL. BOLD ones are my favourites.

Title: Re: Samples Gallery
Post by: bplus on March 09, 2020, 01:41:48 am
Got it saved for reference in my files, Thanks Ashish

@TempodiBasic the 2 of those that were mine have updates, Battleship v5-AI is in Games, if you liked that old version you should love the one in Games. Sudoku, I also have much newer version, I keep thinking there is something more to finish but I don't get around to it. Larry's interpreter? was that posted here? if not do you have .zip or .7z? if not too much trouble.
Title: Re: Samples Gallery
Post by: Qwerkey on March 10, 2020, 11:26:29 am
@bplus We have now modest but reasonable numbers in Samples to start with - Math & Geometry and SUB _GL are still low.  Your working through Ashish's supplied list will add to SUB _GL, I'm sure.  You are doing a tremendous amount of work here and you have the skills to properly assess projects' code relevance for submission.  If it would be any help to you, I could do the administrative job of moving projects to Samples/Games (that's just about at my skill level), but please carry on doing that as well if you like to.  The Library Staff grading should be as follows:
Chief Librarian (a dynamic but static position)
Techinal Support (Qualification required: B+ or above)
Skivvy (I can do that: British meaning required here!)
Title: Re: Samples Gallery
Post by: Qwerkey on March 10, 2020, 11:34:30 am
@bplus Re pi-in-the-sky.  I agree with your assessment that the code is spaghetti-ish and without good structure.  On the other hand it is a good demonstration/comparison of the modern QB64 graphical methods (which is why I wrote it).  Can we agree to shelve it until I've tidied up the code and inserted useful explanatory comments, so that it might be a half-decent bit of code?
Title: Re: Samples Gallery
Post by: Qwerkey on March 10, 2020, 11:49:03 am
@bplus Another way I could help somewhat is if you take the first 10 of Ashish's, and I'll do the last 6.  At least I could do something (I've adjusted the ratio in line with work rate).
Title: Re: Samples Gallery
Post by: bplus on March 10, 2020, 12:05:14 pm
@Qwerkey yeah cooking is good re: Pi-in-sky AND everywhere! Look what 's cooking again with Battleship, it never ends to those who want continuous improvement.

re: library heirarchy
You know everyone has certain skill sets that they bring to this forum. The post before you are implying I maybe more technically proficient than you, not so, you are employing Mem techniques in Pi-in-the sky something I haven't accomplished yet. We (maybe even the Librarian) need help from everyone who has specific experience in different technical areas or just another set of eyes and perspective. I welcome all public and private hints so that we raise and maintain a high quality to serve as example.

I'd sure like to wash out the image of QB64 this guy seems to have (from enthusiastic fan of Liberty Basic at their forum) :
https://libertybasiccom.proboards.com/thread/974/owe-apology-failed-defend-honor


Qwerkey you just posted again. ;-))
For Open_GL, I say pick a half dozen best WOW!s to get attention, (there is not separate board for that subject so use samples to generate interest until there is something more to work from. I don't think this stuff is written in stone a sample can be replaced by better. I am certainly no better judge for WOW factor than you (I am pretty sure) and certainly not more knowledgeable of Open_GL. I do have allot things on my plate specially since STxAxTIC opened a can worms with SB interpreter. I would like to do a dictionary thing with your Scra8813, get Sprite Editor back on track with file loader, and at present get an angled pong paddle to return a ball with some control of angle. ;-)) PS simple examples (that WOW) are good because new folks can pick them up and carry them further. I don't know if Librarian knows anymore of Open_GL than we do? Who can be expert at everything?
Title: Re: Samples Gallery
Post by: STxAxTIC on March 10, 2020, 01:24:44 pm
Quote
Who can be expert at everything?

I know one guy but we went off and dd his own thing. His forums should be opening soon though. Because I'm not that guy, I tend to stay in my lane. Math is a wide lane but doesn't automatically include what to tell to openGL. This makes me thankful for guys like Ashish.
Title: Re: Samples Gallery
Post by: bplus on March 10, 2020, 05:00:44 pm
@Qwerkey

Re: Ashish review

I recommend the first on his list Menger Sponge 1st for me too!
2nd 3D Double Pendulum

Here are all my comments:

Quote
BPLUS Likes! Get this in OPEN_GL samples!
Menger Sponge - https://www.qb64.org/forum/index.php?topic=2251.msg114913#msg114913
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/menger_sponge.bas

BPLUS OK
3D Sierpinski Triangle - https://www.qb64.org/forum/index.php?topic=1088.msg102815#msg102815
GitHub -https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/3D%20Sierpinshki%20Triangle.bas

BPLUS OK+
Cube Plasma - https://www.qb64.org/forum/index.php?topic=271.msg1513#msg1513
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Cube_Plasma.bas

BPLUS nice but can do nicer in 2D graphic, I did a mod of Johnno
Cube Wave - https://www.qb64.org/forum/index.php?topic=179.msg938#msg938
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Cube%20Wave.bas

BPLUS I like 3D Double Pendulum better
3D Spirograph - https://www.qb64.org/forum/index.php?topic=162.msg869#msg869
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/3D_Sprigograph.bas

BPLUS pretty nice! This would be good sample
3D Double Pendulum - https://www.qb64.org/forum/index.php?topic=153.msg828#msg828
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Double_Pendulum_3D.bas


=============================================================== Everything below needs Images or Library N/A Doesn't Github offer provisions for supplemental files?

360 Degree Image - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/360_Degree_Image.bas
3D Textured Cube - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/3D%20Texture%20Cube.bas
Music Maker By Ashish - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Music_Maker_By_Ashish.bas
OpenGL Context Capture - https://www.qb64.org/forum/index.php?topic=282.msg1648#msg1648
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/OpenGL_Context_Capture.bas
Petr's OpenGL 3D World - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/OpenGL_3D_World.bas
Petr's Torus Light - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Petr's_Torus_Lights.bas
Petr's Fog & Blending - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/Petr's_fog_and_blending.bas
Petr's GL text rendering - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/text_rendering.bas
OpenGL Earth - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/OpenGL_Earth.bas
OpenGL Planets - on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]
GitHub - https://github.com/AshishKingdom/QB64_OpenGL_Demos/blob/master/OpenGL_Planets.bas

And 3 more I dug up from my saves:
Quote
BPLUS Saves from past:
3D Knot 3/9/2019
https://www.qb64.org/forum/index.php?topic=169.msg902#msg902

OpenGL Lights & Material By Ashish update 2017-07-30 (I posted at QB64.org 3/10/2020)
https://www.qb64.org/forum/index.php?topic=2323.msg115505#msg115505

STARWARS Opening Crawl 6/26/2019
https://www.qb64.org/forum/index.php?topic=1453.msg106611#msg106611

Title: Re: Samples Gallery
Post by: Ashish on March 11, 2020, 08:25:43 am
@bplus
If you look at the repository, it contain all the supplementary files/resources as well as screenshots and many other GL programs which I have not
mention -
https://github.com/AshishKingdom/QB64_OpenGL_Demos
I recommend you to download the full demo package along with resources for
testing/grading purposes - https://github.com/AshishKingdom/QB64_OpenGL_Demos/archive/master.zip
Title: Re: Samples Gallery
Post by: bplus on March 11, 2020, 10:58:57 am
@bplus
If you look at the repository, it contain all the supplementary files/resources as well as screenshots and many other GL programs which I have not
mention -
https://github.com/AshishKingdom/QB64_OpenGL_Demos
I recommend you to download the full demo package along with resources for
testing/grading purposes - https://github.com/AshishKingdom/QB64_OpenGL_Demos/archive/master.zip


@Qwerkey  how are you coming along with this? I am getting tired of digging around when IMHO the whole package zip or 7z (I don't have rar because I didn't like it when I did.) should be here at QB64 forum. https://www.qb64.org/forum/index.php?topic=178.msg937#msg937

Title: Re: Samples Gallery
Post by: Qwerkey on March 11, 2020, 12:00:13 pm
IMHO the whole package zip or 7z (I don't have rar because I didn't like it when I did.) should be here at QB64 forum. https://www.qb64.org/forum/index.php?topic=178.msg937#msg937

@bplus I think that I agree with you.  Leave Ashish's (& Petr's) stuff with me for the moment - you've done more than enough - and I'll look into it (I've been busy elsewhere the last couple of days).  Already you've given me a good indication and I'll root out the Wow! subjects for Samples.  Just a few more of those and we'll have a conflab of Library Staff to see how STxAxTIC wants us to go from there.  Who would have thought that leafing through members' wondrous projects and posting precis* onto the site could be so wearying?  We can just take things at a gentle pace.
* precis here is plural - the plural of precis is apparently precis.  What you learn at this site!
Title: Re: Samples Gallery
Post by: TempodiBasic on March 11, 2020, 08:11:26 pm
@bplus
larryln's interpreter
here link in this forum
https://www.qb64.org/forum/index.php?topic=1754.msg110056#msg110056 (https://www.qb64.org/forum/index.php?topic=1754.msg110056#msg110056)
Title: Re: Samples Gallery
Post by: bplus on March 11, 2020, 08:34:30 pm
@bplus
larryln's interpreter
here link in this forum
https://www.qb64.org/forum/index.php?topic=1754.msg110056#msg110056 (https://www.qb64.org/forum/index.php?topic=1754.msg110056#msg110056)

Ah now I remember, thanks TempodiBasic. When I hear Italy in the news this week, I think about you.
Title: Re: Samples Gallery
Post by: TempodiBasic on March 12, 2020, 07:40:17 am
Thanks Bplus
I think that time goes over, so we need do and wait, no more!
Today all shops are closed except Public Health offices and structures, shops of first necessity like bakery, greengrover and all those with alimentar goods, moreover tobacconists  ....
 :-)))  the government let you choose if you want survive or if you want send in smoke your life!
A very democratic / liberal  line guides.. :-)))
Title: Re: Samples Gallery
Post by: bplus on March 12, 2020, 11:51:57 am
Quote
Today all shops are closed except Public Health offices and structures, shops of first necessity like bakery, greengrover and all those with alimentar goods, moreover tobacconists  ....
 :-)))  the government let you choose if you want survive or if you want send in smoke your life!
A very democratic / liberal  line guides.. :-)))

I heard viruses don't like cigarette smoke, gives them cancer...  or something like that,... maybe it was bacteria because they are a whole organism. ;)
Title: Re: Samples Gallery
Post by: Qwerkey on March 12, 2020, 01:05:58 pm
@Ashish I have just added a couple of your OpenGL programs to Samples.  What we really like is for the code to be full of helpful comments.  Would you be able to update another of your GL programs (one that has the wow factor that we like) with suitable extra comment lines?  And if it's good I can add that (place the updated code in Programs, if not already there).  Thanks.
Title: Re: Samples Gallery
Post by: Ashish on March 12, 2020, 01:10:30 pm
@Qwerkey
Sure. Mention the program(s) which I need to comment. I will comment it fully.
You are using "Ashish Kingdom" instead of "Ashish" in Samples Gallery Topic name. "AshishKingdom" is my Github username BTW.
Title: Re: Samples Gallery
Post by: Qwerkey on March 12, 2020, 01:12:19 pm
@Ashish Pardon me for this error.
Title: Re: Samples Gallery
Post by: Qwerkey on March 13, 2020, 05:21:32 am
@Ashish Your 3D:Sierpinski Cube program https://www.qb64.org/forum/index.php?topic=2251.msg114913#msg114913 (https://www.qb64.org/forum/index.php?topic=2251.msg114913#msg114913) looks a good one for Samples (high rating from bplus).  If you would add as many helpful comments for the inexperienced OpenGL user that'd be good.  Also possibly Esc to quit the program?
Title: Re: Samples Gallery
Post by: bplus on March 13, 2020, 11:28:47 am
Yes, Menger sponge and 3D Knot too and Star Wars crawl looks better than mine I think!
Title: Re: Samples Gallery
Post by: Ashish on March 14, 2020, 03:43:33 am
@Qwerkey
Menger Sponge [Commented]

Code: QB64: [Select]
  1. '@Author:Ashish Kushwaha
  2. '28 Feb, 2020s
  3. _TITLE "Menger Sponge"
  4. SCREEN _NEWIMAGE(600, 600, 32)
  5.  
  6. TYPE vec3
  7.     x AS SINGLE
  8.     y AS SINGLE
  9.     z AS SINGLE
  10.  
  11.     SUB glutSolidCube (BYVAL dsize AS DOUBLE) 'use to draw a solid cube by taking the side length as its arguement
  12.  
  13. 'Algorithm
  14. '1. We take a cube.
  15. '2. We divide it into 27 equal cubical parts.
  16. '3. Out of this 27 cubes, 7 cubes are removed.
  17. '4. In the remaining 20 cubes, Step-1 is repeated for each cube.
  18. iteration = 3 'no. of iteration. At each iteration, 7 cubes are removed from parent cube.
  19. size = 0.5 'the size of our first cube
  20. n = (20 ^ iteration) - 1
  21.  
  22. DIM SHARED glAllow, cubeLoc(n) AS vec3, fundamentalCubeSize 'cubeLoc array store the location of cubes to be rendered. They are the smallest cube which are formed in the last iteration
  23. fundamentalCubeSize = size / (3 ^ iteration) 'the size the smallest cube which is formed in the last iteration
  24. initFractal 0, 0, 0, size, iteration 'this sub done all calculation for cube location & other stuff.
  25.  
  26. PRINT (n + 1); " Cubes will rendered with total of "; 8 * (n + 1); " vertices"
  27. PRINT "Hit a Key"
  28. glAllow = 1 'to start rendering in the SUB _GL
  29.     _LIMIT 40
  30.  
  31. SUB _GL () STATIC
  32.     DIM clr(3)
  33.     IF glAllow = 0 THEN EXIT SUB 'So that rendering will start as soon as initialization is done.
  34.     IF glInit = 0 THEN
  35.         _glViewport 0, 0, _WIDTH, _HEIGHT 'this defines the area in the screen where GL rendering will occur
  36.         aspect# = _WIDTH / _HEIGHT
  37.  
  38.         glInit = 1
  39.     END IF
  40.  
  41.     _glEnable _GL_DEPTH_TEST 'this enable Z-buffer. So that we can do 3D things.
  42.     _glClear _GL_DEPTH_BUFFER_BIT OR _GL_COLOR_BUFFER_BIT 'Not required unless we do softwre rendering as well.
  43.  
  44.     'LIGHTS CONFIG
  45.     _glEnable _GL_LIGHTING 'this enable us to use light. There are max of 8 lights in GL
  46.     _glEnable _GL_LIGHT0
  47.     clr(0) = 0.2: clr(1) = 0.2: clr(2) = 0.2: clr(3) = 1
  48.     _glLightfv _GL_LIGHT0, _GL_AMBIENT, _OFFSET(clr()) 'this define the color of the material where light can hardly reach.
  49.     clr(0) = 0.8: clr(1) = 0.8: clr(2) = 0.8: clr(3) = 1
  50.     _glLightfv _GL_LIGHT0, _GL_SPECULAR, _OFFSET(clr()) 'this define the color of the material where light is directly reflected & reach your eye.
  51.     _glLightfv _GL_LIGHT0, _GL_DIFFUSE, _OFFSET(clr()) 'this define the default/usual color of the light on the material.
  52.     clr(0) = 0: clr(1) = 0: clr(2) = 0: clr(3) = 1
  53.     _glLightfv _GL_LIGHT0, _GL_POSITION, _OFFSET(clr()) 'use to define the direction of light when 4th component is 0. When 4th component is 1, it defines the position of light. In this case, the light looses its intensity as distance increases.
  54.  
  55.     _glMatrixMode _GL_PROJECTION 'usually used for setting up perspective etc.
  56.     _gluPerspective 60, aspect#, 0.1, 10 'first arguement tell angle for FOV (Field of View, for human it is round 70degree for one eye.LOL) next one aspect ratio, next 2 are near & far distance. Objects which are not between these distance are clipped. (or are not rendered.)
  57.  
  58.     _glMatrixMode _GL_MODELVIEW 'rendering takes place here
  59.  
  60.     _glTranslatef 0, 0, -1 'move the origin forward by 1 unit
  61.     _glRotatef _MOUSEX, 0, 1, 0 'these are for rotation by the movement of mouse.
  62.     _glRotatef _MOUSEY, 1, 0, 0
  63.  
  64.     drawFractal 'draws the fractal
  65.     _glFlush 'force all the GL command to complete in finite amount of time
  66.  
  67. SUB initFractal (x, y, z, s, N) 'x-position, y-position, z-position, size, N-> iteration
  68.     STATIC i
  69.         'As we divide the cube, value of N decreases.
  70.     IF N = 0 THEN 'when the division is done N times (no. of iteration)
  71.         cubeLoc(i).x = x 'store the coordinates of cube
  72.         cubeLoc(i).y = y
  73.         cubeLoc(i).z = z
  74.         i = i + 1
  75.         ' ? "Added #",i
  76.         ' sleep
  77.         EXIT SUB
  78.     END IF
  79.     'top section
  80.     'front row, left to right
  81.     initFractal (x - s / 3), (y + s / 3), (z + s / 3), s / 3, N - 1
  82.     initFractal (x), (y + s / 3), (z + s / 3), s / 3, N - 1
  83.     initFractal (x + s / 3), (y + s / 3), (z + s / 3), s / 3, N - 1
  84.     'behind the previous row, left to right
  85.     initFractal (x - s / 3), (y + s / 3), (z), s / 3, N - 1
  86.     initFractal (x + s / 3), (y + s / 3), (z), s / 3, N - 1
  87.     'behind the previous row, left to right
  88.     initFractal (x - s / 3), (y + s / 3), (z - s / 3), s / 3, N - 1
  89.     initFractal (x), (y + s / 3), (z - s / 3), s / 3, N - 1
  90.     initFractal (x + s / 3), (y + s / 3), (z - s / 3), s / 3, N - 1
  91.     'middle section
  92.     'front row, left to right
  93.     initFractal (x - s / 3), (y), (z + s / 3), s / 3, N - 1
  94.     initFractal (x + s / 3), (y), (z + s / 3), s / 3, N - 1
  95.     'behind the previous row (last one as middle one contain no cube ;) ), left to right
  96.     initFractal (x - s / 3), (y), (z - s / 3), s / 3, N - 1
  97.     initFractal (x + s / 3), (y), (z - s / 3), s / 3, N - 1
  98.     'bottom section
  99.     'front row, left to right
  100.     initFractal (x - s / 3), (y - s / 3), (z + s / 3), s / 3, N - 1
  101.     initFractal (x), (y - s / 3), (z + s / 3), s / 3, N - 1
  102.     initFractal (x + s / 3), (y - s / 3), (z + s / 3), s / 3, N - 1
  103.     'behind the previous row, left to right
  104.     initFractal (x - s / 3), (y - s / 3), (z), s / 3, N - 1
  105.     initFractal (x + s / 3), (y - s / 3), (z), s / 3, N - 1
  106.     'behind the previous row, left to right
  107.     initFractal (x - s / 3), (y - s / 3), (z - s / 3), s / 3, N - 1
  108.     initFractal (x), (y - s / 3), (z - s / 3), s / 3, N - 1
  109.     initFractal (x + s / 3), (y - s / 3), (z - s / 3), s / 3, N - 1 '20
  110.  
  111.  
  112. SUB drawFractal ()
  113.     FOR i = 0 TO UBOUND(cubeLoc)
  114.         _glPushMatrix 'save the previous transformation configuration
  115.         _glTranslatef cubeLoc(i).x, cubeLoc(i).y, cubeLoc(i).z 'move at given location
  116.         glutSolidCube fundamentalCubeSize 'draws the solid cube of smallest size which is formed in the last iteration
  117.         _glPopMatrix 'restore the original transformation configuration
  118.     NEXT
  119.  

3D Knots [Commented]
Code: QB64: [Select]
  1. 'Coded in QB64 by Ashish on 9 March, 2018
  2. 'http://paulbourke.net/geometry/knots/
  3. _TITLE "3D Knot [Press space for next knot]"
  4.  
  5. SCREEN _NEWIMAGE(700, 700, 32)
  6.  
  7. TYPE vec3
  8.     x AS SINGLE
  9.     y AS SINGLE
  10.     z AS SINGLE
  11. DECLARE LIBRARY 'used for camera.
  12.     SUB gluLookAt (BYVAL eyeX#, BYVAL eyeY#, BYVAL eyeZ#, BYVAL centerX#, BYVAL centerY#, BYVAL centerZ#, BYVAL upX#, BYVAL upY#, BYVAL upZ#)
  13.  
  14. DIM SHARED glAllow AS _BYTE, knot_type, ma 'knot_type store the type knot being drawn. ma store percentage of knot which is being drawn.
  15. knot_type = 1
  16. glAllow = -1
  17.  
  18.     k& = _KEYHIT
  19.     IF k& = ASC(" ") THEN
  20.         knot_type = knot_type + 1
  21.         ma = 0
  22.         IF knot_type > 7 THEN knot_type = 1 '7 knots are there.
  23.     END IF
  24.     _LIMIT 60
  25.  
  26. SUB _GL ()
  27.     STATIC glInit, clock
  28.     ' static r, pos, theta, phi, beta
  29.  
  30.     IF NOT glAllow THEN EXIT SUB
  31.  
  32.     IF NOT glInit THEN
  33.         glInit = -1
  34.         aspect# = _WIDTH / _HEIGHT
  35.         _glViewport 0, 0, _WIDTH, _HEIGHT
  36.     END IF
  37.    
  38.     _glEnable _GL_DEPTH_TEST 'We are doing 3D. This enables Z-Buffer.
  39.    
  40.         'set perspective configuration
  41.     _glMatrixMode _GL_PROJECTION
  42.     _gluPerspective 45.0, aspect#, 1.0, 100.0
  43.    
  44.     _glMatrixMode _GL_MODELVIEW
  45.     ' gluLookAt 0,0,-1,0,0,0,0,1,0
  46.    
  47.     _glColor3f 1, 1, 1 'set color
  48.     _glTranslatef 0, 0, 0 'not require. becoz, origin is already at 0,0,0
  49.     _glRotatef clock * 90, 0, 1, 0 'rotation along Y-axis
  50.     _glLineWidth 3.0 'width of the line.
  51.    
  52.     SELECT CASE knot_type
  53.         CASE 7 'equations are knots are taken from paulbourke site
  54.             _glBegin _GL_LINE_STRIP
  55.                         'for animation, value of ma is gradually increased till a certain constant. In this case, it is pi.
  56.             FOR beta = 0 TO ma STEP .005
  57.                 r = .3 + .6 * SIN(6 * beta)
  58.                 theta = 2 * beta
  59.                 phi = _PI(.6) * SIN(12 * beta)
  60.                 x = r * COS(phi) * COS(theta)
  61.                 y = r * COS(phi) * SIN(theta)
  62.                 z = r * SIN(phi)
  63.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  64.                 _glVertex3f x, y, z 'draws it.
  65.             NEXT
  66.             _glEnd
  67.             IF ma <= _PI THEN ma = ma + .005
  68.                         'others are made to be rendered in the same way.
  69.         CASE 6
  70.             _glBegin _GL_LINE_STRIP
  71.             FOR beta = 0 TO ma STEP .005
  72.                 r = 1.2 * 0.6 * SIN(_PI(.5) * 6 * beta)
  73.                 theta = 4 * beta
  74.                 phi = _PI(.2) * SIN(6 * beta)
  75.                 x = r * COS(phi) * COS(theta)
  76.                 y = r * COS(phi) * SIN(theta)
  77.                 z = r * SIN(phi)
  78.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  79.                 _glVertex3f x, y, z
  80.             NEXT
  81.             _glEnd
  82.             IF ma <= _PI(2) THEN ma = ma + .005
  83.         CASE 5
  84.             k = 1
  85.             _glBegin _GL_LINE_STRIP
  86.             FOR u = 0 TO ma STEP .005
  87.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  88.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  89.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  90.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  91.                 _glVertex3f x, y, z
  92.             NEXT
  93.             _glEnd
  94.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  95.         CASE 4
  96.             k = 2
  97.             _glBegin _GL_LINE_STRIP
  98.             FOR u = 0 TO ma STEP .005
  99.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  100.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  101.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  102.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  103.                 _glVertex3f x, y, z
  104.             NEXT
  105.             _glEnd
  106.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  107.         CASE 3
  108.             k = 3
  109.             _glBegin _GL_LINE_STRIP
  110.             FOR u = 0 TO ma STEP .005
  111.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  112.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  113.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  114.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  115.                 _glVertex3f x, y, z
  116.             NEXT
  117.             _glEnd
  118.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  119.         CASE 2
  120.             _glBegin _GL_LINE_STRIP
  121.             FOR u = 0 TO ma STEP .005
  122.                 x = (41 * COS(u) - 18 * SIN(u) - 83 * COS(2 * u) - 83 * SIN(2 * u) - 11 * COS(3 * u) + 27 * SIN(3 * u)) / 200
  123.                 y = (36 * COS(u) + 27 * SIN(u) - 113 * COS(2 * u) + 30 * SIN(2 * u) + 11 * COS(3 * u) - 27 * SIN(3 * u)) / 200
  124.                 z = (45 * SIN(u) - 30 * COS(2 * u) + 113 * SIN(2 * u) - 11 * COS(3 * u) + 27 * SIN(3 * u)) / 200
  125.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  126.                 _glVertex3f x, y, z
  127.             NEXT
  128.             _glEnd
  129.             IF ma < _PI(2) THEN ma = ma + .005
  130.         CASE 1
  131.             _glBegin _GL_LINE_STRIP
  132.             FOR u = 0 TO ma STEP .005
  133.                 x = (-22 * COS(u) - 128 * SIN(u) - 44 * COS(3 * u) - 78 * SIN(3 * u)) / 200
  134.                 y = (-10 * COS(2 * u) - 27 * SIN(2 * u) + 38 * COS(4 * u) + 46 * SIN(4 * u)) / 200
  135.                 z = (70 * COS(3 * u) - 40 * SIN(3 * u)) / 200
  136.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  137.                 _glVertex3f x, y, z
  138.             NEXT
  139.             _glEnd
  140.             IF ma < _PI(2) THEN ma = ma + .005
  141.     END SELECT
  142.     _glFlush
  143.    
  144.     clock = clock + .01
  145.  
  146. FUNCTION map! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
  147.     map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
  148.  

STARWARS Opening Crawl [Commented]

Code: QB64: [Select]
  1. '###########################
  2. '# StarWars Opening Crawl  #
  3. '# By Ashish               #
  4. '###########################
  5.  
  6. _TITLE "STARSWARS Opening crawl"
  7.  
  8. SCREEN _NEWIMAGE(800, 600, 32)
  9.  
  10. DIM SHARED glAllow, text&, text2&, lines$(26)
  11. DIM SHARED starWars&
  12. 'Feel free to modify the value of these lines as your wish. You can also add more lines by increasing the array length then adding values for next
  13. lines$(0) =  "It is a period of civil war"
  14. lines$(1) =  "Rebel spaceships, striking"
  15. lines$(2) =  "from a hidden base, have "
  16. lines$(3) =  "won their first victory"
  17. lines$(4) =  "against the evil Galactic"
  18. lines$(5) =  "Empire."
  19. lines$(6) =  ""
  20. lines$(7) =  ""
  21. lines$(8) =  "During the battle, rebel"
  22. lines$(9) =  "spies managed to steel"
  23. lines$(10) =  "secret plans to the Empire's"
  24. lines$(11) =  "ultimate weapon, the DEATH"
  25. lines$(12) =  "STAR, an armored space station"
  26. lines$(13) =  "with enough to destroy an entire"
  27. lines$(14) =  "planet."
  28. lines$(15) =  ""
  29. lines$(16) =  ""
  30. lines$(17) =  "Pursued by the Empire's sinister"
  31. lines$(18) =  "agents, Princess Leia races"
  32. lines$(19) =  "home abroad her starship,"
  33. lines$(20) =  "custodian of the stolen plans"
  34. lines$(21) =  "that cansave her people and"
  35. lines$(22) =  "restore the freedom to the galaxy"
  36. lines$(23) =  ""
  37. lines$(24) =  ""
  38. lines$(25) =  ""
  39. lines$(26) =  "QB64 Rocks!"
  40.  
  41. 'What am I actually doing?
  42. '1. I create an image handle text& as per our array length of lines$
  43. '2. I create another copy this image handle in text2&
  44. '3. Then, I print all the text in that image with suitable color in text2& image
  45. '4. After this, I draw the text2& image on text& image and move it from bottom to top.
  46. '5. I use text& as a texture for plane in 3D which is tilted somewhat.
  47. '6. So, as the image move in text&, the plane have corresponding texture in the plane. In fact, if draw anything on text&, it will textured on plane as well. (like bouncing balls, plasma, etc)
  48. text& = _NEWIMAGE(280, (UBOUND(lines$) + 1) * _FONTHEIGHT, 32)
  49.  
  50. text2& = _COPYIMAGE(text&)
  51. starWars& = _NEWIMAGE(65, 17, 32)
  52.  
  53. _DEST starWars&
  54. COLOR _RGB32(255, 255, 255)
  55. _PRINTSTRING (0, 0), "STARWARS"
  56.  
  57. COLOR _RGB(0, 0, 255)
  58. centerPrint "A long time ago in galaxy far,", _WIDTH, 280
  59. centerPrint "far away...", _WIDTH, 308
  60. FOR i = 0 TO 255 STEP 5
  61.     LINE (0, 0)-(_WIDTH, _HEIGHT), _RGB32(0, 0, 0, i), BF
  62.     _DISPLAY
  63.     _DELAY 0.01
  64. _PUTIMAGE (_WIDTH / 2 - _WIDTH(starWars&) * 3, _HEIGHT / 2 - _HEIGHT(starWars&) * 3)-STEP(_WIDTH(starWars&) * 6, _HEIGHT(starWars&) * 6), starWars&
  65. FOR i = 0 TO 255 STEP 5
  66.     LINE (0, 0)-(_WIDTH, _HEIGHT), _RGB32(0, 0, 0, i), BF
  67.     _DISPLAY
  68.     _DELAY 0.01
  69. _DEST text2&
  70. COLOR _RGB(255, 220, 0), _RGB(0, 0, 0)
  71. FOR i = 0 TO UBOUND(lines$)
  72.     IF i = UBOUND(lines$) THEN COLOR _RGB(255, 0, 255)
  73.     centerPrint lines$(i), _WIDTH, y + i * _FONTHEIGHT
  74.  
  75. glAllow = -1
  76. COLOR _RGB(255, 220, 0), _RGBA(0, 0, 0, 0)
  77. y = _HEIGHT(text&) + 10
  78.  
  79.  
  80.     _DEST text&
  81.     _PUTIMAGE (0, y), text2&
  82.     y = y - 1
  83.     _LIMIT 30
  84. LOOP UNTIL y < -_HEIGHT(text2&) - 10
  85.  
  86. SUB centerPrint (t$, w, y)
  87.     _PRINTSTRING ((w / 2) - (LEN(t$) * _FONTWIDTH) / 2, y), t$
  88.  
  89. SUB _GL ()
  90.     STATIC glInit, tex&, texMem AS _MEM ', clock!
  91.     IF NOT glAllow THEN EXIT SUB
  92.     IF glInit = 0 THEN
  93.         glInit = -1
  94.         _glViewport 0, 0, _WIDTH, _HEIGHT
  95.         texMem = _MEMIMAGE(text&) 'creating texture
  96.         _glGenTextures 1, _OFFSET(tex&)
  97.     END IF
  98.        
  99.     IF glInit = -1 THEN clock! = clock! + 0.01
  100.        
  101.     _glEnable _GL_TEXTURE_2D 'enable us to use 2D texture
  102.     _glEnable _GL_DEPTH_TEST 'enable us to go 3D. Enables Z-Buffer
  103.  
  104.  
  105.  
  106.     _glMatrixMode _GL_PROJECTION 'set up perspective
  107.     _gluPerspective 60.0, _WIDTH / _HEIGHT, 0.01, 10
  108.  
  109.     _glMatrixMode _GL_MODELVIEW
  110.      
  111.          'pass the image data each time, as the text& is modified everytime
  112.     _glTexImage2D _GL_TEXTURE_2D, 0, _GL_RGB16, _WIDTH(texMem.IMAGE), _HEIGHT(texMem.IMAGE), 0, _GL_BGRA_EXT, _GL_UNSIGNED_BYTE, texMem.OFFSET
  113.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MAG_FILTER, _GL_LINEAR
  114.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MIN_FILTER, _GL_LINEAR
  115.  
  116.     'draws the plane with texture
  117.     _glBegin _GL_QUADS
  118.     _glBindTexture _GL_TEXTURE_2D, tex&
  119.     _glTexCoord2f 0, 1: _glVertex3f -0.8, -1, -0.5 'bottom left     #
  120.     _glTexCoord2f 1, 1: _glVertex3f 0.8, -1, -0.5 'bottom right     # Coordinates sign are same as in Cartesian Plane   (3D)
  121.     _glTexCoord2f 1, 0: _glVertex3f 0.8, 3, -7 'upper right       #
  122.     _glTexCoord2f 0, 0: _glVertex3f -0.8, 3, -7 ' upper left      #
  123.     _glEnd
  124.  
  125.  
  126.     _glFlush
  127.  


PS: I don't like to comment much in code. For this reason, one of my friend (newbie) who also code in Qb64, doesn't like this habit of mine.
Title: Re: Samples Gallery
Post by: krovit on March 14, 2020, 07:47:38 am
Hi Ashish!
Beautiful effects. really beautiful.

You're there again and still write with qb64... What good news!

I am very pleased to use the code of your drop-down menu (GUI-Menu Bar), that I allowed to modify a little to suit my needs.
Simple, efficient, light... it's just great!

I'm sorry if I take the opportunity to ask you something...
Why don't you complete the code with the keyboard control so you can use the drop-down menu with the one as well as the mouse?

Thank you very much!




Title: Re: Samples Gallery
Post by: Ashish on March 14, 2020, 09:55:24 am
Hello @krovit
Thank You, I am glad you like it!
I am sure that you might be using an old code of GUI-Menu-Bar. The latest one support keyboard control as well.
The project is hosted here - https://github.com/AshishKingdom/GUI-Menu-Bar
You can download the latest one from here - https://github.com/AshishKingdom/GUI-Menu-Bar/archive/master.zip
I never thought that this can be useful for someone. There is much better and advance GUI support in @FellippeHeitor InForm.
Title: Re: Samples Gallery
Post by: bplus on March 14, 2020, 11:44:33 am
Quote
PS: I don't like to comment much in code. For this reason, one of my friend (newbie) who also code in Qb64, doesn't like this habit of mine.

Think of it as giving yourself notes 5 years into the future when you don't have a clue what you did with the code :)

I think this is main reluctance of Qwerkey to go revisit Scra88l3. Without code broken into functional blocks and commented it is hard to modify or fix because it's hard to figure out all over again.

Title: Re: Samples Gallery
Post by: TerryRitchie on March 14, 2020, 11:48:19 am
Think of it as giving yourself notes 5 years into the future when you don't have a clue what you with the code :)

Amen brother! That's why I do it.
Title: Re: Samples Gallery
Post by: Qwerkey on March 15, 2020, 08:13:21 am
@STxAxTIC @bplus
Now that we have a reasonable (starting) number of Samples/Games, I feel that we can begin to revert to "normal" Library activities - Library Staff keeping an eye out for suitable projects and having members submit requests.  But I'd like to feature Samples from our most prolific members.  The attached shows a table of (in my judgement) our most prolific members and if they have at least one in Samples and/or one in Games.  If agreeable, I'd like to put out a request to those missing a Smiley Face to ask them if they'd like to make submissions?  After we have done that extra task then we'll revert to purely normal Library activities.  Good idea / Bad Idea?  List needs amending?
  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Samples Gallery
Post by: johnno56 on March 15, 2020, 09:32:11 pm
I can contribute when and if I can... but, based on my current skill level, I do not believe I have earned the right to be included on the list... I appreciate the gesture but would prefer that my name be removed. Thank you...
Title: Re: Samples Gallery
Post by: bplus on March 15, 2020, 10:59:08 pm
Pete has a sample? Oh he's the smiley :)

He does have a Space Invaders spoof thing that's fun.

Petr has a music player with graphics timed to music as I recall.

jack might have a math thing that would blow STxAxTIC's socks off?

I know Cobalt has a game somewhere probably his current one.

Johnno's Sprite Editor got stuck on a problem I would like to see solved.
Title: Re: Samples Gallery
Post by: Qwerkey on March 16, 2020, 07:10:32 am
@johnno56 We all have our various skills.  We Librarians will not press any member to contribute to Samples.  It will only ever be if a member specifically wishes to do so.
Title: Re: Samples Gallery
Post by: Qwerkey on March 16, 2020, 07:45:22 am
@bplus Do you think that we should include any more of Erik Oredson's stuff?  His Recursive Descent Parser looks technical (too technical for me).  His Symbolic Instruction Code Kit is already in Interpreters.  If you have any other projects that you'd like me to do the admin on, please say - I know that you've been looking at Steve's material which is again too technical for me.
Title: Re: Samples Gallery
Post by: bplus on March 16, 2020, 10:01:19 am
Hi @Qwerkey,

I never got into Erik's stuff much, reminded me of a bunch of old DOS utilities. I tried SICK and decided to stick with modern day Interpreters but building your own Interpreter is great adventure, instructive challenge! The Recursive Decent Parser is vital part of Interpreter, other people might call it Evaluate or Eval what processes coded text strings into variables and values... yep complex, I was just looking at Steve's massive one the other day, used in QB64! Has Erik "cooked" any of his code in the Programs Board here?

Steve is well represented but I suppose I should get around to getting his keyboard customizer that fixes keycodes and allows you to code your keyboards special keys before buried in the past. I think I was waiting for Terry's endorsement after testing. Maybe he is as eager to test as I, ha, ha! Steve should have his own board, already has a version of SDL QB64 going. Steve is a QB6force of nature! ;-))

I am curious what in samples is Pete's, I looked and am not seeing it? Could you remind me?

Title: Re: Samples Gallery
Post by: Qwerkey on March 16, 2020, 12:43:14 pm
@bplus To get a Smiley Face, you only need a contribution to a collaborative Samples project. https://www.qb64.org/forum/index.php?topic=1069.0 (https://www.qb64.org/forum/index.php?topic=1069.0)  As STxAxTIC hasn't warned me off issuing an invite for Samples, I'll create a new post here for that.
Title: Re: Samples Gallery
Post by: bplus on March 16, 2020, 01:51:02 pm
Ah! The ellipse fill yes, Pete found some interesting speed test results as I recall (now).

Thanks Qwerkey!