Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Qedo

Pages: [1] 2 3 4
1
this simple program work correctly in GlBasic 10.283 and creates a sprite hole, while don't work in Glbasic 11.414  (see the picture)
Any idea?
Ciao


id% = GENSPRITE()
// Create virtual screen
CREATESCREEN 1,id%,32,32

USESCREEN 1
DRAWRECT 0,0,31,31,RGB(255,255,255) // white background os the sprite
DRAWRECT 4,4,24,24,RGB(255,0,128)  // transparent hole in the sprite

USESCREEN -1
DRAWRECT 100,100,70,70,RGB(255,0,0)  // draw the red background

DRAWSPRITE id%,120,120  // draw the sprite

SHOWSCREEN
MOUSEWAIT

2
GLBasic - en / Re: Something wired
« on: 2012-Jun-16 »
Hi kanonet,
on my computer CPUs Intel i7-2630QM GPU 540M in both cases with qSIN(i) the times are the same: 440ms +/-10.
There is no true difference.
ciao
qedo

3
GLBasic - en / Re: Something wired
« on: 2012-Jun-16 »
Hi kanonet,
on my computer in both cases the times are the same: 80ms
ciao
qedo

4
Code Snippets / Re: new QSIN (QQSIN)
« on: 2012-Mar-12 »

@kanonet
Code: GLBasic [Select]
How did you do your calculations, starting with Gernots one again, or just adding to our last version?
 
I started by Gernot  and your code and in detail i have substituted the original numeric value in this way:
// 65535 = (2^16)-1
// 182.04166666666666666666666666667 = 65535/360
// 0.00012206791406720535999456453271949 =   0.02222144652331750907567718514381/182.04166666666666666666666666667
// 0.000000003725515635463640657766991220193 = 0.00012346049003081125437778164739108/(182.04166666666666666666666666667^2)

And instead How did you do your calculations?
As you have deleted a multiplication?
Good
Ciao




5
Code Snippets / Re: new QSIN (QQSIN)
« on: 2012-Mar-11 »
My version QQSIN2.
Perhaps not the most precise but faster, almost 50%.
I enclose an application of.
Ciao

FUNCTION QQSIN2: x  // by Qedo
LOCAL xx%
xx=x* 182.04166666666666666666666666667
xx=bAND(xx , 65535)
   IF xx < 32767
      x = ( 0.00012206791406720535999456453271949 - 0.0000000037255156354636406577669912201935 * xx)* xx
      RETURN ( 0.775 + 0.225 * x ) * x
   ENDIF
   xx= 32767 - xx
   x = ( 0.00012206791406720535999456453271949 + 0.0000000037255156354636406577669912201935 * xx) * xx
   RETURN ( 0.775 - 0.225 * x ) * x
ENDFUNCTION

6
GLBasic - en / GPS on Android
« on: 2012-Mar-08 »
Hi,
I'm writing a program for runners on Android. Someone's how to use GPS module?
Thank you
Ciao

7
GLBasic - en / Re: 2D Physics Library
« on: 2012-Feb-26 »
Insert the  attached box2d files in the pogram's folder
Ciao

8
GLBasic - en / Re: 2D Physics Library
« on: 2012-Feb-26 »
I attach an example with sprites that I hope will be useful
Ciao

9
GLBasic - en / Re: array index
« on: 2012-Feb-25 »
Thank you for your helps.
Here the 2 methods, static and dymanic array, and benchmark


      INLINE
         int height4d_C = array4dLen_C; //27
         int depth4d_C = array4dLen_C * array4dLen_C; //729
         int time4d_C = array4dLen_C * array4dLen_C * array4dLen_C; //19683
         const int array4dLen_C=27;
         const int array1dLen_C=array4dLen_C * array4dLen_C * array4dLen_C * array4dLen_C;
         
         // Fill STATIC STACK 1d array simulating 4d         
         static int array1d_C[array1dLen_C];
         for (tc = 0; tc < array4dLen_C; tc++)
            for (zc = 0; zc < array4dLen_C; zc++)
               for (yc = 0; yc < array4dLen_C; yc++)
                  for (xc = 0; xc < array4dLen_C; xc++)
                     array1d_C[xc + yc * height4d_C + zc * depth4d_C + tc * time4d_C] = i;

         // Fill DYNAMIC HEAP 1d array simulating 4d
         int *array4dd_C;
         array4dd_C = new int[array4dLen_C * array4dLen_C * array4dLen_C * array4dLen_C];
         for (tc = 0; tc < array4dLen_C; tc++)
            for (zc = 0; zc < array4dLen_C; zc++)
               for (yc = 0; yc < array4dLen_C; yc++)
                  for (xc = 0; xc < array4dLen_C; xc++)
                     array4dd_C[xc + yc * height4d_C + zc * depth4d_C + tc * time4d_C] = i;
         delete[] array4dd_C;
      ENDINLINE
      
Time comparation for 531441 int array
STATIC STACK ARRAY= 0,6 seconds
DYNAMIC HEAP ARRAY= 1,8 seconds

Ciao

10
GLBasic - en / Re: array index
« on: 2012-Feb-15 »
Thank you hardyx
now work!!!  =D
Ciao

      INLINE
         int tc, zc, yc;
         const int array3dLen_C=81;
         static int array3d_C[array3dLen_C][array3dLen_C][array3dLen_C];
         for (tc = 0; tc < array3dLen_C; tc++)
            for (zc = 0; zc < array3dLen_C; zc++)
               for (yc = 0; yc < array3dLen_C; yc++)
                   array3d_C[yc][zc][tc] = i;
      ENDINLINE

11
GLBasic - en / array index
« on: 2012-Feb-12 »
hello all.
where is the mistake?
with  array3dLen_C = 80 all OK. With upper indices there is the error:
EXCEPTION_STACK_OVERFLOW.

ciao

INLINE
      int tc, zc, yc;
      int array3dLen_C=80;
      int array3d_C[array3dLen_C][array3dLen_C][array3dLen_C];
      for (tc = 0; tc < array3dLen_C; tc++)
         for (zc = 0; zc < array3dLen_C; zc++)
            for (yc = 0; yc < array3dLen_C; yc++)
                array3d_C[yc][zc][tc] = i;
ENDINLINE

12
GLBasic - en / Re: Arrays in Types?
« on: 2011-Nov-13 »
Try:

CONSTANT MaxDims=3
TYPE Point
     Loc[]
ENDTYPE
LOCAL P1 AS Point
REDIM P1.Loc[MaxDims]
FOR i = 0 TO MaxDims-1
      IF P1.Loc=0 THEN P1.Loc=10
NEXT

Ciao

13
It may seem obvious but it is true. Many thanks for informations and availability
Ciao

14
Code Snippets / Re: POW speed
« on: 2011-Sep-18 »
But where it is very useful in calculations of the type Bezier algorithm:
B(t)=(1-t)5P1 + 5t(1-t)4P2 + 10t2(1-t)3P3 + 10t3(1-t)2P4 + 5t4(1-t)P5+ t5P6
Ciao

15
Code Snippets / Re: POW speed
« on: 2011-Sep-18 »
I forgot to add that the elevations should not be decimal.
3, 5, 6, -4, -6 yes
-3,5, 5.67   no
Ciao

Pages: [1] 2 3 4