Weird, but also using X_SPRITE after a X_DRAWAXES makes all the X_SPRITE textures go blue...?
Even with... X_SETTEXTURE -1, -1...
Hopes this helps nail down the bug.
Even with... X_SETTEXTURE -1, -1...
Hopes this helps nail down the bug.
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 MenuWHILE 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
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'...?*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.095 - 3D, NET
"test.gbas"(14) error : wrong argument type : myfunc, arg no: 1
Quote from: GernotFrischGif meh zeh guhn!LOL, I went to babelfish (As I do quite a bit) to translate this from German to English... then I realised what it said... haha... doh!
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.095 - 3D, NET
"test.gbas"(12) error : wrong argument type : X_CAMERA, arg no: 1
TYPE is not declared
Main program...// --------------------------------- //
// Project: TEST.GBAS
// Start: Saturday, April 14, 2007
// IDE Version: 4.154
foo()
WHILE TRUE
X_MAKE3D 1,5500,45
X_CAMERA cameraPosition.x, cameraPosition.y, cameraPosition.z, cameraTarget.x, cameraTarget.y, cameraTarget.z
SHOWSCREEN
WEND
Dummy library...// --------------------------------- //
// Project: CAMERA_LIB.GBAS
// Start: Saturday, April 14, 2007
// IDE Version: 4.154
// Types
TYPE Tvector
x
y
z
magnitude
ENDTYPE
// Globals
FUNCTION foo:
GLOBAL PI = 3.1415926535
GLOBAL cameraPosition AS Tvector
GLOBAL cameraTarget AS Tvector
GLOBAL cameraUpVector AS Tvector
GLOBAL radius = 1
GLOBAL moveDist = 1
GLOBAL hRadians
GLOBAL vRadians
ENDFUNCTION
//Functions
FUNCTION SetCamera: cPosition AS Tvector, h ,v
hRadians = h
vRadians = v
ENDFUNCTION
The above program does nothing but illustrate how I can not modularise types, globals and functions in the one file. I need this to post some stuff on the forums or use code between programs.
// --------------------------------- //
// Project: particles_test (800x600 res.)
// Start: Saturday, April 14, 2007
// IDE Version: 4.154
TYPE Tvector
x
y
z
magnitude
ENDTYPE
GLOBAL cam_pos AS Tvector; cam_pos.x = 0; cam_pos.y = 0; cam_pos.z = 0
GLOBAL cam_vec AS Tvector; cam_vec.x = 0; cam_vec.y = 0; cam_vec.z = 0.1
WHILE TRUE
X_MAKE3D 1,5500,45
MOUSESTATE mx, my, b1, b2
// mx = MOD(GETTIMERALL()/10,3600) // Unremark these 1 at a time, to see the problem more clearly
// my = MOD(GETTIMERALL()/10,3600) // Look out for camera axis flipping at Y 0 or 180
cam_vec.x = 0; cam_vec.y = 0; cam_vec.z = -1
mx=(mx/800)*3600
my=(my/600)*3600
cam_vec = Vector_RotateAroundY(cam_vec, mx/10)
cam_vec = Vector_RotateAroundX(cam_vec, my/10)
X_CAMERAUP 0,1,0
X_CAMERA cam_pos.x, cam_pos.y, cam_pos.z, cam_vec.x, cam_vec.y, cam_vec.z
X_DRAWAXES 100,0,0
X_DRAWAXES -100,0,0
X_DRAWAXES 0,100,0
X_DRAWAXES 0,-100,0
X_DRAWAXES 0,0,100
X_DRAWAXES 0,0,-100
X_PRINT "Right X+",100,0,0,0.3
X_PRINT "Left X-",-100,0,0,0.3
X_PRINT "Up Y+",0,100,0,0.3
X_PRINT "Down Y-",0,-100,0,0.3
X_PRINT "Out Z+",0,0,100,0.3
X_PRINT "In Z-",0,0,-100,0.3
X_MAKE2D
PRINT "CX: "+cam_vec.x,10,20
PRINT "CY: "+cam_vec.y,10,30
PRINT "CZ: "+cam_vec.z,10,40
PRINT "MX: "+mx/10,10,50
PRINT "MY: "+my/10,10,60
SHOWSCREEN
WEND
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