BASIC

Recent Posts

Pages: [1] 2 3 ... 10
1
tried to delete the temp folder? Sometimes im have seen it mixed with othre projects.
2
GLBasic - en / Kitty Hello: rsrc merge failure: duplicate leaf ????
« Last post by Schranz0r on Yesterday at 10:57 AM »
Hi Gernot,

any possibility to fix this Output:

Code: GLBasic [Select]
precompiling:
precompiling:
GPC - GLBasic Precompiler V.15.394 SN:64771b8d - 3D, NET
Wordcount:6 commands
compiling:

linking:
C:/Program Files (x86)/Steam/steamapps/common/GLBasic_SDK/Compiler/platform/Win32/bin/ld.exe: .rsrc merge failure: duplicate leaf: type: 10 (VERSION) name: 1 lang: 409
success
 

I'm on the Steamversion...
Compiling is fine, but this output is a bit off...
3
GLBasic - en / Re: Multiple poly vector shapes
« Last post by Kitty Hello on 2019-Oct-17 »
Polynews is faster than start/end.
4
GLBasic - en / Re: GLBasic
« Last post by erico on 2019-Oct-16 »
I think it is a matter of sending them an email to evaluate the product and from there you can take part.
Also, how are the image problem going on on the forum?

I was going to repost some stuff but better wait till the full transition.
5
GLBasic - en / Re: GLBasic
« Last post by Moru on 2019-Oct-16 »
Great with new server and backup!

Anyone know how much work and costs it would be to set up a humblebundle? Since the steam version is done it could be easy? I often see other game makers on there, like RPG maker and that other popular engine whatever it was called, and they do get quite a few sales if you can depend on the counter they display on the site.
6
GLBasic - en / Re: Multiple poly vector shapes
« Last post by erico on 2019-Oct-15 »
A quick look into the 2d snippets, I think this 2 examples will help you out:

http://www.glbasic.com/forum/index.php?topic=11073.0
In this case, Spacefractal is substituting drawrect for polyvectors and he is generating multiple rectangles shapes that way.
He seems to be using POLYNEWSTRIP command for that.

http://www.glbasic.com/forum/index.php?topic=10411.0
This is by Hemlos and also does a great job with polyvectors and multiple shapes.
I recall this impressed me a lot on the polyvector side of things so it might be a good place to start.

I hope that helps you out, sorry it took a while to answer. ;)
7
GLBasic - en / Re: Multiple poly vector shapes
« Last post by erico on 2019-Oct-15 »
I haven´t used polivectors enough to feel confident in helping you out.
Out of memory, I recall one can start and end each polivector call, and should have at least 3 points within that that should be called in an anti-clockwise order.
I think you also can´t have some commands in between start and end poly.

I ran and read your code and it seems ( I could be wrong) that you are only calling polystart an polyend once and that will always draw a single polygon, you would have to call that again or probably put that inside a loop to call it as many times as you have full separated shapes.

If you want to resolve the thing in a single call, like your code shows, you could use the polynewstrip command?
That would lift the "pen" and create disconnected shapes.

I suspect though that calling polystart/end for each closed shape is a better solution and am confident I have seen code for that around the forum.
If I can find it I will add here, otherwise we just wait a bit for a more knowledge user to pop by. ;)


 
8
GLBasic - en / Multiple poly vector shapes
« Last post by Bluepixel on 2019-Oct-14 »
Hi there, i was playing around with GLBasic, trying to make a polygon editing tool, i've included some code down below, it doesn't have any media included so you can just paste it into GLBasic and it should work. Anyways, currently I can add several poly vectors, which you can then create a shape with, however you can only create ONE shape.

Can anyone help me figure out on how to add more shapes?



Code: GLBasic [Select]
// --------------------------------- //
// Project: PolyEdit
// --------------------------------- //
width=640
height=480
SETSCREEN width, height, 0 // Set the width and height of my screen
ALLOWESCAPE TRUE
SYSTEMPOINTER TRUE

setup: // Set up all variables and other systems
        maxpoints=1
        clicktogg=FALSE

        TYPE poly
                x=0
                y=0
                active=FALSE
        ENDTYPE

        GLOBAL polypoints[] AS poly
        DIM polypoints[maxpoints]
GOTO main


main: // The main loop
        MOUSESTATE mx, my, mba, mbb // Return mouse values

        GOSUB polypoint

        IF KEY(57) // Quickly resets the game
                GOTO setup
        ENDIF

        drawpointer()
        SHOWSCREEN
GOTO main

SUB polypoint:
        IF mba=1 // Add a poly point once clicked
                IF clicktogg=FALSE
                        clicktogg=TRUE

                        i=maxpoints-1

                        polypoints[i].x=mx
                        polypoints[i].y=my
                        polypoints[i].active=TRUE

                        maxpoints=maxpoints+1

                        LOCAL pointtmp AS poly

                        DIMPUSH polypoints[], pointtmp

                        FOR i=maxpoints-1 TO maxpoints-1
                                polypoints[i].x=0
                                polypoints[i].y=0
                                polypoints[i].active=FALSE
                        NEXT
                ENDIF
        ELSE
                clicktogg=FALSE
        ENDIF

        FOR i=0 TO maxpoints-1 // Draw a little X at each poly point
                IF polypoints[i].active=TRUE
                        PRINT "x", polypoints[i].x-7, polypoints[i].y-9
                ENDIF
        NEXT

        STARTPOLY 1 // Draw the poly itself
                FOR i=0 TO maxpoints-2
                        POLYVECTOR polypoints[i].x, polypoints[i].y, 0, 0, RGB(255,255,255)
                NEXT
        ENDPOLY
RETURN
ENDSUB


FUNCTION drawpointer:
        DRAWLINE 0, my, width, my, RGB(255,255,255)
        DRAWLINE mx, 0, mx, width, RGB(255,255,255)
ENDFUNCTION

Ps. Sorry for the messy code, I haven't cleaned it up yet
9
A 3D hexagon (or hexagonal prism) is just a particular cylinder.
If you use this function with slices=6, you normally get a hexagonal prism (I have not tested).

CreateCylinder(0,  16, 16, 16,  6, 1,  RGB(255, 0, 0))

Code: GLBasic [Select]

FUNCTION CreateCylinder: num, baseRadius, topRadius, height, slices, stacks, col
LOCAL da, r, dr, dz, x, y, z, i, j
LOCAL x1, y1, x2, y2
        da = 360 / slices
        dr = (topRadius-baseRadius) / stacks
        dz = height / stacks

        X_AUTONORMALS 2
        X_OBJSTART num
        FOR i=0 TO slices-1
                x1 = COS(i*da)
                y1 = SIN(i*da)
                x2 = COS((i+1)*da)
                y2 = SIN((i+1)*da)
                z = 0
                r = baseRadius

                // Bottom lid
                IF baseRadius>0
                        X_OBJADDVERTEX 0, 0, 0,  .5, .5, col
                        X_OBJADDVERTEX x1*r, y1*r, 0, x1/2+.5, y1/2+.5, col
                        X_OBJADDVERTEX x2*r, y2*r, 0, x2/2+.5, y2/2+.5, col
                        X_OBJNEWGROUP
                ENDIF
                // side
                FOR j=0 TO stacks
                        X_OBJADDVERTEX x2*r, y2*r, z, (i+1)/slices,  j/stacks, col
                        X_OBJADDVERTEX x1*r, y1*r, z,  i   /slices,  j/stacks, col
                        z = z+dz
                        r = r+dr
                NEXT
                // Top lid
                IF topRadius>0
                        X_OBJNEWGROUP
                        X_OBJADDVERTEX x2*r, y2*r, height, x2/2+.5, y2/2+.5, col
                        X_OBJADDVERTEX x1*r, y1*r, height, x1/2+.5, y1/2+.5, col
                        X_OBJADDVERTEX 0, 0, height,  .5, .5, col
                ENDIF
                X_OBJNEWGROUP
        NEXT
        X_OBJEND
ENDFUNCTION

 
10
GLBasic - en / Re: GLBasic
« Last post by Snoopy on 2019-Oct-13 »
currectly im heard he is more focus on the HTML5/Javascript port, which is ace. Its a platform that got more more supported by various devices. Etc easier to ports really.
Hmm, I remember we talked a lot about this famous HTML5/Javascript port  ;)
Like you, I always thought it was the best and simplest solution (although for 3D, there will be big difficulties).
Pages: [1] 2 3 ... 10