Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 494
» Latest member: johtopoz3021
» Forum threads: 2,841
» Forum posts: 26,619

Full Statistics

Latest Threads
another variation of "10 ...
Forum: Programs
Last Post: JRace
42 minutes ago
» Replies: 28
» Views: 363
QB64PE v4.0 is now live!!
Forum: Announcements
Last Post: Kernelpanic
3 hours ago
» Replies: 44
» Views: 2,202
Next small EQ step - EQ D...
Forum: Petr
Last Post: Petr
4 hours ago
» Replies: 11
» Views: 578
Chr$(135) and _Keyhit
Forum: Help Me!
Last Post: SMcNeill
5 hours ago
» Replies: 3
» Views: 38
New QBJS Samples Site
Forum: QBJS, BAM, and Other BASICs
Last Post: DANILIN
6 hours ago
» Replies: 32
» Views: 1,254
Might not be able to be o...
Forum: Announcements
Last Post: Pete
Today, 03:26 AM
» Replies: 0
» Views: 27
Aloha from Maui guys.
Forum: General Discussion
Last Post: Pete
Today, 03:00 AM
» Replies: 13
» Views: 285
Fun with Ray Casting
Forum: a740g
Last Post: Bhsdfa
Today, 01:45 AM
» Replies: 1
» Views: 49
Box_Bash game
Forum: Works in Progress
Last Post: Pete
Yesterday, 09:57 PM
» Replies: 2
» Views: 59
1990's 3D Doom-Like Walls...
Forum: Programs
Last Post: a740g
01-11-2025, 09:31 PM
» Replies: 5
» Views: 193

 
  Rotating Sphere in Visual Basic
Posted by: eoredson - 01-16-2023, 01:31 AM - Forum: QBJS, BAM, and Other BASICs - Replies (1)

Speaking of other basics and 3-d arrays for rotating sphere:

Code: (Select All)
Sphere is v9.0a of the rotating stereoscopic sphere integral.

Program Sphere displays a rotating real-time integral of the sphere which
can be modified over x/y/z axis, +/- radius, and switch to mono mode. This
red/blue output can be visualized with 'stage' glasses to simulate 3-D
views.

Stage glasses contain a red filter on the left lens and a blue filter
on the right lens.

Sphere v7.0a upgrades include movable/restorable buttons in freeze mode.

Sphere v8.0a upgrades add PictureBox & TextBox movable objects, and
corrects a small divide by zero error. Also allows any of 21 buttons
to be Drag 'n' Dropped onto any other of the 21 buttons, including
TextBox and PictureBox dropping..

Sphere v9.0a updates the install procedure to include all missing .ocx files.

Complete source and executable for VB 5.0 are included. Compiled with
VB 5.0 Enterprise w/ Service Pack 3.

This shareware product is public domain and can be distributed freely.

-end-

Here are 2 of them.

Sphere5.zip - original source
Sphere9.zip - latest source.

Erik.


[Image: sphere.png]



these should work in VB5 and VB6..

.zip   sphere5.zip (Size: 25.11 KB / Downloads: 32)
.zip   sphere9.zip (Size: 2.26 MB / Downloads: 43)

Print this item

  Select All
Posted by: Dimster - 01-15-2023, 04:58 PM - Forum: General Discussion - Replies (2)

I don't seem to be able to click, or right click, on the "Code:Select All" option any more whether I'm logged on or not. It's been a while since I tried to Select All so now I'm wondering if I ever did have the option to just click on Select All and all the code was highlighted. Have we lost that ability? It's not a big deal, I am able to just highlight it all by dragging my mouse to the end of code but as I age I continue to fear I'm fantasying a digital world that never existed.

Print this item

  Hardware Images
Posted by: SMcNeill - 01-14-2023, 02:43 PM - Forum: Learning Resources and Archives - Replies (13)

Someone on Discord sent me a couple of messages asking what the big deal was with hardware images, and why anyone would ever bother with them.   I hope the little demo below here will be sufficient enough to showcase why folks might want to make use of hardware images in their programs.

Code: (Select All)
DIM count AS _INTEGER64
displayScreen = _NEWIMAGE(1024, 720, 32)
workScreen = _NEWIMAGE(512, 360, 32)

SCREEN displayScreen
_DEST workScreen
FOR i = 1 TO 100 'draws something on the drawscreen
    LINE (RND * _WIDTH, RND * _HEIGHT)-(RND * _WIDTH, RND * _HEIGHT), _RGB32(RND * 256, RND * 256, RND * 256), BF
NEXT
hardwareScreen = _COPYIMAGE(workScreen, 33)

_DEST displayScreen

PRINT "For this demo, we're going to be scaling and placing a premade image onto the screen."
PRINT "For ease of output, our FPS count is going to be placed up in the TITLE area."
PRINT
PRINT "First, we'll do a FPS cound of simple software images."
PRINT "Let it run a few seconds, and then press <ANY KEY> when you'd like to move on."
PRINT
PRINT "After that, we'll use hardware images AND software images, and see how things compare."
PRINT "As before, watch the TITLE area for updates, and press <ANY KEY> when ready to move on."
PRINT
PRINT "And finally, we'll JUST use hardware images for our display."
PRINT "Once again, our FPS second count will be in the TITLE area, and you can press <ANY KEY> to"
PRINT "move to our final resulsts screen for ease of comparison."
PRINT
PRINT
PRINT "Press <ANY KEY> to begin."
SLEEP

_DELAY .5
_KEYCLEAR 'time to release any key


time# = TIMER + 1
DO
    CLS , 0
    scount = scount + 1
    IF TIMER > time# THEN
        _TITLE "Software FPS:" + STR$(scount)
        IF scount > smax THEN smax = scount
        scount = 0
        time# = TIMER + 1
    END IF
    _PUTIMAGE , workScreen
    _DISPLAY
LOOP UNTIL _KEYHIT

_DELAY .5
_KEYCLEAR 'time to release any key

time# = TIMER + 1
DO
    CLS , 0
    mcount = mcount + 1
    IF TIMER > time# THEN
        _TITLE "Mixed FPS:" + STR$(mcount)
        IF mcount > mmax THEN mmax = mcount
        mcount = 0

        time# = TIMER + 1
    END IF
    _PUTIMAGE , hardwareScreen
    _DISPLAY
LOOP UNTIL _KEYHIT

_DELAY .5
_KEYCLEAR 'time to release any key

time# = TIMER + 1
_DISPLAYORDER _HARDWARE
CLS , 0
DO
    hcount = hcount + 1
    IF TIMER > time# THEN
        _TITLE "Hardware FPS:" + STR$(hcount)
        IF hcount > hmax THEN hmax = hcount
        hcount = 0
        time# = TIMER + 1
    END IF
    _PUTIMAGE , hardwareScreen
    _DISPLAY
LOOP UNTIL _KEYHIT

_DISPLAYORDER _SOFTWARE , _HARDWARE
CLS , 0
_AUTODISPLAY

PRINT USING "###,###,### FPS with Software Images"; smax
PRINT USING "###,###,### FPS with Software and Hardware Images"; mmax
PRINT USING "###,###,### FPS with Hardware Images only"; hmax
PRINT
PRINT
PRINT "I would think the figures here alone, would showcase why one might want to use hardware images over other types, when possible."






[Image: image.png]

Print this item

  Trying out some old programs from QB45.org
Posted by: CharlieJV - 01-14-2023, 04:09 AM - Forum: QBJS, BAM, and Other BASICs - Replies (13)

These are programs from the (previously) "QB45.org" site that I find particularly interesting.  In the BAM version of the source code, you'll find the details of the original source code that you can grab for QB64pe. 

From "Graphics Demos" file category:


(More to come from the qb45.org site.)

Print this item

  _OPENHOST to port 443 fails
Posted by: jleger2023 - 01-14-2023, 03:08 AM - Forum: Help Me! - Replies (9)

Hey all,

This is my first post here. I'm tinkering with QB64 to create a simple server. Listening on port 80 or port 8080 works just fine, but when I try to listen on port 443 it always returns 0 (fail). I've added port access to the Windows firewall and even tried disabling the firewall completely in case I'd done something wrong, but it still fails.

Here's my code. Any ideas? Thanks in advance.

Code: (Select All)
Dim socketHost As Integer
Dim socketClients(1000) As Integer
Dim clientIndex As Integer
Dim socketClient As Integer
Dim socketData As String

socketHost = _OpenHost("TCP/IP:443")

If socketHost Then
    Print "LISTENING @ " + _ConnectionAddress(socketHost)
    Do
        socketClient = _OpenConnection(socketHost)
        If socketClient Then
            socketClients(clientIndex) = socketClient
            clientIndex = clientIndex + 1
        End If

        For i = 0 To clientIndex - 1
            Get #socketClients(clientIndex), , socketData
            Print socketData
        Next
    Loop

    Close #socketHost
Else
    Print "Failed to open socket to port 443."
End If

Print this item

  _WIDTH(_LOADIMAGE()) Ok?
Posted by: TerryRitchie - 01-13-2023, 01:45 PM - Forum: Help Me! - Replies (9)

I recently saw some code that did this:

ImageWidth = _WIDTH(_LOADIMAGE("Image.png", 32))

Will this leave the image's contents in RAM with no way of freeing it?

-or-

Will the image be discarded since the handle was not assigned to a variable?

It's a neat trick and one that I could happen to use on a current project but not if the image is orphaned in RAM.

Print this item

  What folder IDE defaults to, for opening files
Posted by: bert22306 - 01-13-2023, 04:14 AM - Forum: General Discussion - Replies (2)

Okay, I see that maybe this belonged in the general discussion area:

Is there any way to configure the IDE of v3.5.0 to open .bas files by default in the last folder you used? That, and using File Explorer, were my favorite improvements in 3.4.1.

Was there a deliberate decision to always open inside the qb64pe folder instead? I never store my programs there. Does anyone use that folder for their .bas files? Seems messy.

If there's an easy way to fix this, without having to wait for another complete version update, that would be great.

Print this item

  Upgrading from version to version
Posted by: bobalooie - 01-13-2023, 02:34 AM - Forum: General Discussion - Replies (3)

General question: When upgrading from one version to another (say 3.4 to 3.5), which files in the upgrade package are really essential to perform the upgrade? For instance, I see in the 3.5 package that all of the c folder has the same rev date as the rest of the package, but I would be surprised if the entire toolchain is upgraded.

Print this item

  Final Alchemy
Posted by: PhilOfPerth - 01-11-2023, 12:30 AM - Forum: Games - Replies (9)

I've made a few changes to my Alchemy word game, that make it a bit more enjoyable to play. I've also re-checked each pair of words and verified that they are solvable within the number of moves allowed, and provided my "best results" in the Pairs list in the game, but these can be reset to the maximum of 21 changes. The files are attached as a 7zip file.
The Wordlists folder needs to be in the same folder as the alchemy file.
.7z   alchemy.7z (Size: 576.73 KB / Downloads: 91)

Print this item

  Simple 3D morphing with _MAPTRIANGLE
Posted by: RokCoder - 01-10-2023, 11:41 PM - Forum: Programs - Replies (6)

I went on a complete tangent from what I was intending to do this evening when I stumbled upon _MAPTRIANGLE!

First this project creates the vertices of a cube - but it does this based on a hard-coded TESSELATION constant. If this is set to one then each face of the cube has four vertices, if it's set to two then each face has nine vertices, 16 vertices for a value of 4, etc.

The reason for allowing the tessellation is that the project continually morphs between a cube and a sphere (while rotating on three axes). The higher the tessellation value, the better the quality of the sphere but also the greater the number of vertices, calculations, triangles to render, etc. I wanted the code to be clear and well commented so it isn't optimised at all (which is why I've set the tessellation value quite low).

The ZIP file containing the project and its assets is attached. As always, you can also find the code over at my GitHub.

   


.zip   morph.zip (Size: 419.28 KB / Downloads: 58)

On a side note, does anyone know if _CLOCKWISE and _ANTICLOCKWISE actually do anything at the moment in _MAPTRIANGLE? I tried using it to do the back-face culling but it didn't seem to have any effect so I ended up using cross-products for the culling.

On a second side note, is there any command for altering the brightness while rendering? I had a brief go with _SETALPHA for each triangle being rendered but (a) it didn't seem to affect _MAPTRIANGLE and (b) the performance impact was horrendous.

Print this item