Menu

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.

Show posts Menu

Topics - bigsofty

#261
OK, Santa's coming, the wifies asking what Id like, the GPX F200 looks like a fun toy... anyone got one and would like to share their experiences before we buy?
#262
Just an idea for the future, how about binding OpenGL(or ES) API directly into the GLBasic command set, allowing low level programming of openGL using GLBasic variables without in-line? This would be a powerful addition and allow the user to take language as far as he wishes graphically without imposing on Gernots time.
#263
I just upgraded from 4.26 to 5.062.

I had to change SPRITE to DRAWSPRITE and FILLRECT to DRAWRECT but nothing more... now my little program has went from 200+fps to <10fps?!?!

Is there something else I should be aware of, I'm using 2D commands on Win32...
#264
Every time I start the IDE (5.055) it detects update 5.062 but when it actually tries to download it I get the following message...

Code (glbasic) Select
Current Version:
5.055000
Opening Internet-Connection
Opening Info-File
Reading Update Information
Version:
4.279
No Update available. GLBasic is up to date.
Ende.
?
#265
GLBasic - en / Newton
2007-Aug-25
Not a small request I know... but any chance of the Newton library being officially inserted into the GLBasic command set. Full compiler error checking, manual and run time error support. As a separate C++ library its a little unapproachable by your average basic programmer.

It could be a big selling point.

Just an idea.
#266
GLBasic - en / Debug CLS
2007-Jul-05
Could we have a command for clearing the debug console, after a few regular DEBUG prints its very confusing whats happening.

for example a loop with...

Code (glbasic) Select
   DEBUG "MX: "+mx +","
    DEBUG "MY: "+my+","
produces...

Code (glbasic) Select
MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,MX: 0,MY: 0,...with the debug console scrolling continuously

If we had the command DEBUGCLS

Code (glbasic) Select
   DEBUGCLS
    DEBUG "MX: "+mx +","
    DEBUG "MY: "+my
Code (glbasic) Select
MX: 0,MY: 0or

Code (glbasic) Select
   DEBUGCLS
    DEBUG "Mouse Co-Ordinates"+"\n"
    DEBUG "------------------"+"\n"
    DEBUG "MX: "+mx +"\n"
    DEBUG "MY: "+my+"\n"
produces...

Code (glbasic) Select
   Mouse Co-Ordinates
    ------------------
    MX: 0
    MY: 0
Just a suggestion ;)
#267
When I turn debug on...

DEBUG command does not output to the debug window?

Single stepping through code, does not show where you are in the code?
#268
GLBasic - en / INLINE calls
2007-May-14
Code (glbasic) Select
INLINE
bool LoadFile(char *filename)
{    
return true;
}
ENDINLINE
ENDFUNCTION
How do I call the above inline C subroutine from GLBasic with the correct parameter and types...?

Also...

Where do I put my...
Code (glbasic) Select
#include // Header File For Standard Input / Output
#269
GLBasic - en / x_sprite
2007-May-07
May I suggest a speed up for x_sprite.

Rather than calculate the view angle every billboard (X_Sprite) individually, is it possible to have the option to use one global angle for every billboard in a scene. I realise this can cause some slight visual quirks but as each x_sprite needs a view to camera angle calculation, this gets expensive when using thousands of billboards (particles).

My particle system is quite efficient but Im getting slowdowns at about 1000 particles... in C and straight openGL, I can hit 10000 particles...
#270
I use X_PRINT and X_DRAWAXES to show some debug info on my 3D objects in my scene. But some of the Axis's have been disappearing after I use X_PRINT?


Code (glbasic) Select
WHILE TRUE
  X_MAKE3D 1,5500,45

    X_DRAWAXES 0,0,-100
   
//    X_PRINT "test",0,0,-50,0.3 // Unremark this line to see bug...

    X_DRAWAXES 10,10,-100


  SHOWSCREEN
WEND
#271
Why does this not work...

Code (glbasic) Select
TYPE Tmytype
foo$
ENDTYPE

GLOBAL testvar AS Tmytype

WHILE 1
myfunc(testvar)
WEND


FUNCTION myfunc: BYREF a AS Tmytype
a.foo$ = "Foo!"
ENDFUNCTION
... probably me doing something silly? I want to pass a custom type 'byref'...?
Code (glbasic) Select
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.095 - 3D, NET
"test.gbas"(14) error : wrong argument type : myfunc, arg no: 1
#272
Im having a lot of trouble keeping my code in separate modules (files) together with there variables.

My library code is almost always the same.

Types
Global Variables
SubRoutines

I keep getting "TYPE  is not declared", Ive tried putting the variables in a function and calling it from the main program but Im still getting this error.

I mainly get this error if I try and read (from the main program)  a globally declared variable from a library

Any ideas?
#273
GLBasic - en / Camera Vector
2007-Apr-14
I want to control the camera direct via a direction vector.

Simply... its not working... the camera view flips when pointing directly up or directly down.
also
when the X axis is added to the equation it spirals the view sometimes....

There must be an easier way to use a direction vector to control the camera angle?

This is what Ive been trying (800x600 windowed)...


Code (glbasic) Select
// View code
TYPE Tvector
x
y
z
magnitude
ENDTYPE

GLOBAL cam_pos AS Tvector; cam_pos.x = 0; cam_pos.y = 0; cam_pos.z = 0 // Camera position
GLOBAL cam_vec AS Tvector; cam_vec.x = 0; cam_vec.y = 0; cam_vec.z = 0 // Camera angle

// Mouse look along vector code...
  MOUSESTATE mx, my, b1, b2
  cam_vec.x = 0; cam_vec.y = 0; cam_vec.z = -1 // Initial view
mx=(mx/800)*3600 // Get an x rotation value
my=(my/600)*3600 // Get an y rotation value
cam_vec = Vector_RotateAroundY(cam_vec, mx/10) // Rotatate around x axis
  cam_vec = Vector_RotateAroundX(cam_vec, my/10) // Rotate around y axis
    X_CAMERA cam_pos.x, cam_pos.y, cam_pos.z, cam_vec.x, cam_vec.y, cam_vec.z
Functions from the vector lib.


Code (glbasic) Select
FUNCTION Vector_RotateAroundX AS Tvector: vec1 AS Tvector, angle
LOCAL result AS Tvector
result.x = vec1.x
result.y = COS(angle) * vec1.y - SIN(angle) * vec1.z
result.z = SIN(angle) * vec1.y + COS(angle) * vec1.z
RETURN result
ENDFUNCTION

FUNCTION Vector_RotateAroundY AS Tvector: vec1 AS Tvector, angle
LOCAL result AS Tvector
result.x  = COS(angle) * vec1.x + SIN(angle) * vec1.z
result.y = vec1.y
result.z = -SIN(angle) * vec1.x + COS(angle) * vec1.z
RETURN result
ENDFUNCTION

FUNCTION Vector_RotateAroundZ AS Tvector: vec1 AS Tvector, angle
LOCAL result AS Tvector
result.x = COS(angle) * vec1.x - SIN(angle) * vec1.y
result.y = SIN(angle) * vec1.x + COS(angle) * vec1.y
result.z = vec1.z
RETURN result
ENDFUNCTION
#274
Seems to be quite slow compared to my old BOUNDS method for typed arrays?
#275
Alphamode does not work in 3D, It simply does not blend properly using 'X_SPRITE' for example. Im writing a 3D particle system and its stopping the particles from blending properly. Works fine in 2D mode thought.

I have seen this problem before, as part of the development of Blitz3D, its a depth sorting issue with alpha blended textures... it was sorted by introducing the W-Buffer... not sure if its the same for OpenGL...
#276
Code (glbasic) Select
TYPE Tvector
x
y
z
magnitude
ENDTYPE

FUNCTION vector_new AS Tvector: x,y,z,m
LOCAL result AS Tvector
result.x=x
result.y=y
result.z=z
result.magnitude=m
RETURN result
ENDFUNCTION

FUNCTION add_to_particles_array: a, b, vec AS Tvector
ENDFUNCTION

FUNCTION testf:
add_to_particles_array(1, 1, vector_new(100,100,0,0))
ENDFUNCTION
produces this error...

Code (glbasic) Select
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.083 - 3D, NET
Wordcount:8 commands

compiling:
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp: In function `DGInt __GLBASIC__::testf()':
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:35: error: invalid initialization of non-const reference of type '__GLBASIC__::Tvector&' from a temporary of type '__GLBASIC__::Tvector'
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:29: error: in passing argument 3 of `DGInt __GLBASIC__::add_to_particles_array(DGInt, DGInt, __GLBASIC__::Tvector&)'
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Time: 0.8 sec
Build: 0 succeeded
*** 1 FAILED ***
This is a small section of offending code I've tried to cut out of my own program... I must be doing this wrong?

:s
#277
GLBasic - en / Toggle Output
2007-Apr-02
Is there a hot key for this?
#278
GLBasic - en / Update: 4.142
2007-Mar-31
My GLBasic says 4.132 and its up to date, so it wont update to the new version?
#279
Could some kind soul add German language comments plz? :)

Code (glbasic) Select
// --------------------------------- //
// Project: VectorLIB
// Start: Wednesday, March 28, 2007
// IDE Version: 4.132


FUNCTION setup_veclib:
//used TO normalize vector
GLOBAL vector_tol = 0.0001
ENDFUNCTION

TYPE Tvector
x
y
z
magnitude
ENDTYPE

FUNCTION vector_calcMagnitude: vec AS Tvector
//calc the magnitude of a vector AND stor in vector
vec.magnitude=SQR(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z)
ENDFUNCTION

FUNCTION vector_normalize: vec AS Tvector
    LOCAL m
//normalize a vector so it's length = 1 AND apply tolerance based on our constant tolerance value
m=SQR(SQR(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z) )
IF m<= vector_tol THEN m=1
vec.x=vec.x/m
vec.y=vec.y/m
vec.z=vec.z/m
IF ABS(vec.x) IF ABS(vec.y) IF ABS(vec.z)ENDFUNCTION

FUNCTION vector_reverse: vec AS Tvector
//reverse a vector
vec.x=-vec.x
vec.y=-vec.y
vec.z=-vec.z
ENDFUNCTION

FUNCTION vector_add AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//add two vectors together AND RETURN the resulting vector
LOCAL result AS Tvector
result.x=vec1.x+vec2.x
result.y=vec1.y+vec2.y
result.z=vec1.z+vec2.z
RETURN result
ENDFUNCTION

FUNCTION vector_subtract AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//subtract vec1 from vec2 AND RETURN the resulting vector
LOCAL result AS Tvector
result.x=vec1.x-vec2.x
result.y=vec1.y-vec2.y
result.z=vec1.z-vec2.z
RETURN result
ENDFUNCTION

FUNCTION vector_scalarMultiply AS Tvector: vec1 AS Tvector, scale
//scalar multiplication of a vector with result returned AS new vector
//used TO scale a vector by 'scale'
LOCAL result AS Tvector
result.x=vec1.x*scale
result.y=vec1.y*scale
result.z=vec1.z*scale
RETURN result
ENDFUNCTION

FUNCTION vector_scalarDivision AS Tvector: vec1 AS Tvector, scale
//scalar division of a vector with result returned AS new vector
//used TO scale a vector
LOCAL result AS Tvector
result.x=vec1.x/scale
result.y=vec1.y/scale
result.z=vec1.z/scale
RETURN result
ENDFUNCTION

FUNCTION vector_conjugate AS Tvector: vec1 AS Tvector
//conjugate operator takes the negative of each vector component
//can be used when subtracting one vector from another OR FOR
//reversing the direction of a vector.
//applying conjugate is the same AS reversing a vector
//returns a new vector
LOCAL result AS Tvector
result.x=-vec1.x
result.y=-vec1.y
result.z=-vec1.z
RETURN result
ENDFUNCTION

FUNCTION vector_crossProduct AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//takes vec1 AND vec2 AND returns the cross product vec1 X vec2
//the cross product is a vector perpendicular TO both vec1 AND vec2
//this is the normal of 2 vectors
LOCAL result AS Tvector
result.x=(vec1.y*vec2.z) - (vec1.z*vec2.y)
result.y=(vec1.z*vec2.x) - (vec1.x*vec2.z)
result.z=(vec1.x*vec2.y) - (vec1.y*vec2.x)
RETURN result
ENDFUNCTION

FUNCTION vector_dotProduct: vec1 AS Tvector, vec2 AS Tvector
//calculate AND RETURN the dot product of 2 vectors (distance)
LOCAL result
result=(vec1.x*vec2.x)+(vec1.y*vec2.y)+(vec1.z*vec2.z)
RETURN result
ENDFUNCTION

FUNCTION vector_tripleScalarProduct: vec1 AS Tvector, vec2 AS Tvector, vec3 AS Tvector
//calculate the triple scalar FUNCTION AND RETURN it
LOCAL result
result=           vec1.x * ( (vec2.y*vec3.z ) - (vec2.z * vec3.y) )
result=result + ( vec1.y * ( (-vec2.x*vec3.z) + (vec2.z * vec3.x) ) )
result=result + ( vec1.z * ( ( vec2.x*vec3.y) + (vec2.y * vec3.x) ) )
RETURN result
ENDFUNCTION
#280
Code (glbasic) Select
// --------------------------------- //
// Project: VectorLIB
// Start: Wednesday, March 28, 2007
// IDE Version: 4.132


FUNCTION setup_veclib:
//used TO normalize vector
GLOBAL vector_tol = 0.0001
ENDFUNCTION

TYPE Tvector
x
y
z
magnitude
ENDTYPE

FUNCTION vector_calcMagnitude: vec AS Tvector
//calc the magnitude of a vector AND stor in vector
vec.magnitude=SQR(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z)
ENDFUNCTION

FUNCTION vector_normalize: vec AS Tvector
    LOCAL m
//normalize a vector so it's length = 1 AND apply tolerance based on our constant tolerance value
m=SQR(SQR(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z) )
IF m<= vector_tol THEN m=1
vec.x=vec.x/m
vec.y=vec.y/m
vec.z=vec.z/m
IF ABS(vec.x) IF ABS(vec.y) IF ABS(vec.z)ENDFUNCTION

FUNCTION vector_reverse: vec AS Tvector
//reverse a vector
vec.x=-vec.x
vec.y=-vec.y
vec.z=-vec.z
ENDFUNCTION

FUNCTION vector_add AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//add two vectors together AND RETURN the resulting vector
LOCAL result AS Tvector
result.x=vec1.x+vec2.x
result.y=vec1.y+vec2.y
result.z=vec1.z+vec2.z
RETURN result
ENDFUNCTION

FUNCTION vector_subtract AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//subtract vec1 from vec2 AND RETURN the resulting vector
LOCAL result AS Tvector
result.x=vec1.x-vec2.x
result.y=vec1.y-vec2.y
result.z=vec1.z-vec2.z
RETURN result
ENDFUNCTION

FUNCTION vector_scalarMultiply AS Tvector: vec1 AS Tvector, scale
//scalar multiplication of a vector with result returned AS new vector
//used TO scale a vector by 'scale'
LOCAL result AS Tvector
result.x=vec1.x*scale
result.y=vec1.y*scale
result.z=vec1.z*scale
RETURN result
ENDFUNCTION

FUNCTION vector_scalarDivision AS Tvector: vec1 AS Tvector, scale
//scalar division of a vector with result returned AS new vector
//used TO scale a vector
LOCAL result AS Tvector
result.x=vec1.x/scale
result.y=vec1.y/scale
result.z=vec1.z/scale
RETURN result
ENDFUNCTION

FUNCTION vector_conjugate AS Tvector: vec1 AS Tvector
//conjugate operator takes the negative of each vector component
//can be used when subtracting one vector from another OR FOR
//reversing the direction of a vector.
//applying conjugate is the same AS reversing a vector
//returns a new vector
LOCAL result AS Tvector
result.x=-vec1.x
result.y=-vec1.y
result.z=-vec1.z
RETURN result
ENDFUNCTION

FUNCTION vector_crossProduct AS Tvector: vec1 AS Tvector, vec2 AS Tvector
//takes vec1 AND vec2 AND returns the cross product vec1 X vec2
//the cross product is a vector perpendicular TO both vec1 AND vec2
//this is the normal of 2 vectors
LOCAL result AS Tvector
result.x=(vec1.y*vec2.z) - (vec1.z*vec2.y)
result.y=(vec1.z*vec2.x) - (vec1.x*vec2.z)
result.z=(vec1.x*vec2.y) - (vec1.y*vec2.x)
RETURN result
ENDFUNCTION

FUNCTION vector_dotProduct: vec1 AS Tvector, vec2 AS Tvector
//calculate AND RETURN the dot product of 2 vectors (distance)
LOCAL result
result=(vec1.x*vec2.x)+(vec1.y*vec2.y)+(vec1.z*vec2.z)
RETURN result
ENDFUNCTION

FUNCTION vector_tripleScalarProduct: vec1 AS Tvector, vec2 AS Tvector, vec3 AS Tvector
//calculate the triple scalar FUNCTION AND RETURN it
LOCAL result
result=           vec1.x * ( (vec2.y*vec3.z ) - (vec2.z * vec3.y) )
result=result + ( vec1.y * ( (-vec2.x*vec3.z) + (vec2.z * vec3.x) ) )
result=result + ( vec1.z * ( ( vec2.x*vec3.y) + (vec2.y * vec3.x) ) )
RETURN result
ENDFUNCTION