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

Messages - matty47

#1
Just getting back into GLBasic after a long hiatus. I wrote some 3d testing code a long time ago (looks like 2007). When I recompile these programs with V15.238 it seems that the .dd models are not being found. I tried adding GetCurrentPath$ to the file name and made sure that the files were in the executable directory but no luck. I also tried loading from a media directory but still no luck.
This is the code. I recently added the GetCurrentDir$ when the original would not work.
Code (glbasic) Select
// --------------------------------- //
// Project: 3dtry
// Start: Monday, September 10, 2007
// IDE Version: 4.279


LOADSPRITE GETCURRENTDIR$()+"floor.png", 0

X_LOADOBJ GETCURRENTDIR$()+"floor1.dda", 0

cam_x =0;cam_y=0.5;cam_z=1.5 //camera postion
cam_dir=0  //camera direction
player_x=0;player_y=0;player_z=0
sz=2 //camera step size
WHILE TRUE
dtime=GETTIMER()
//IF INKEY$="Q" THEN END

X_MAKE3D 0.1,500,60
//X_CULLMODE 0
X_CAMERA cam_x,cam_y,cam_z,cam_x+COS(cam_dir)*sz,cam_y,cam_z+SIN(cam_dir)*sz
X_AMBIENT_LT 0, RGB(200,200,200)
X_SPOT_LT 0,RGB(255,255,255),0,40,0,0,-1,0,100
X_MOVEMENT player_x,player_y,Player_z
//X_SCALING 2,0.25,2
X_SETTEXTURE 0,-1
X_DRAWOBJ 0,0
X_DRAWAXES 0,0,0
X_DOT 2,0,0,10,RGB(255,0,0)
X_DOT 0,0,2,10,RGB(0,0,255)
MoveCam()
//X_3rd_Person(Player_x,Player_y,Player_z,10,1)
//player_x=player_x-0.05
X_MAKE2D
//show the frames per second
fps=((1000/dtime)+fps)/2
delay=delay+dtime
IF delay>1000
delay=0
showFPS=fps
ENDIF
PRINT "FPS: "+INTEGER(showFPS)+"  CamY= "+height,0,0
SHOWSCREEN
WEND







FUNCTION  X_3rd_Person: Player_x, Player_y, Player_z, Max_Cam_dist, Min_Cam_Dist
   IF ein_durchlauf = FALSE
      Distance = Max_Cam_dist
      my = 45
      ein_durchlauf = TRUE
   ENDIF


   X_CAMERA cam_x+Player_x, cam_y+Player_y, cam_z+Player_z,    Player_x, Player_y, Player_z



   INC Distance,MOUSEAXIS(2)*5
   IF Distance < Min_Cam_Dist THEN Distance = Min_Cam_Dist
   IF Distance > Max_Cam_dist THEN Distance = Max_Cam_dist

   mx = mx + MOUSEAXIS(0)/20
   my = my + MOUSEAXIS(1)/20

   IF my < -40 THEN my = -40
   IF my > 80 THEN my = 80

   cam_x = Distance * COS(mx)
   cam_z = Distance * SIN(mx)
   cam_y = Distance * SIN(my)
ENDFUNCTION


FUNCTION MoveCam:
mx=MOUSEAXIS(0)*dtime/5
my=0

IF KEY(200) THEN my=0.06*dtime
IF KEY(208) THEN my=-0.06*dtime
cam_x=cam_x + my*COS(cam_dir)*sz*dtime/500
cam_z=cam_z + my*SIN(cam_dir)*sz*dtime/500

height=X_COLLISIONRAY(0,0,cam_x,cam_y,cam_z,0,-1,0)
cam_y=cam_y+0.5-height
cam_dir=cam_dir+mx*dtime/600
ENDFUNCTION

Any ideas? It would have been great if the X_LoadObj returned something that indicated success or not. The help file does not indicate any return value.
Thanks for any pointers.
#2
3D-snippets / Re: SGEngine
2023-Apr-08
Thanks. What a mountain of work you've done. Everything that I tried ran smoothly. Did you compile for any other platforms?
I am still on non Steam version 15.238.
#3
3D-snippets / Re: SGEngine
2023-Apr-07
I downloaded the archive which is still on Mediafire however it requires a password to extract. Please advise the password. Thanks
#4
Thanks Spacefractal. So Linux has disappeared from the list. Disappointing. It looks like you have to pay extra to get the HTML compiler.
#5
I currently have pre Steam version 15..238 which Webupdate tells me is the latest version. I purchased the full key some 15 years ago. I was thinking that I may update to the Steam version (as this is the only way I will get future updates it seems). I would like to know if the compilers on the Steam version include Linux 64, Android 64, Raspberry Pi 64. I have read forum posts that indicate that both Win32 and Win64 compilers are present. I tried to find further info on Steam but was unsuccessful. Could someone please tell me which platform compilers are included in the Steam version. Thanks for your help.
#6
Media Section / Re: Fonts
2021-May-13
It would appear that the zip file is corrupt and unable to be repaired.
#7
Just to confirm that any of the zip files that I have downloaded appear to be corrupt. Tried to open them with 7zip and Winrar 6. Both progs showed error as "Unexpected end of archive". Running a repair (Winrar) on the files did not fix the problem. Showed a checksum error in all files in the archive. Did something happen to the server files at some point?
#8
Thanks all - I did not know about the -1 at the end of XMake3d
#9
Hopefully not too dumb a question but I need a drawing surface that has 0,0 at the bottom left corner and increases in x and y across and up respectfully. I think I could use a 3d screen with an orthographic camera to implement this however I can't seem to find a command that would make the camera orthographic and not perspective. Is this possible in GLBasic? and (of course) some guidance on how to do it would be greatly appreciated.
Thanks in advance
Matthew
#10
Is there a way to make x_line or x_dot objects pickable with x_collisionray?
I want to be able to draw lines and points on a screen and then pick ( and adjust) individual items.
Thanks for any pointers.
#11
I think I got to the bottom of my troubles. I had the following code in a file called Utils.gbas
Code (glbasic) Select
CONSTANT MaxDims=3

TYPE TPoint
Loc[]
FUNCTION init:x,y,z
DIM self.Loc[MaxDims]
self.Loc[0]=x
self.Loc[1]=y
self.Loc[2]=z
ENDFUNCTION
ENDTYPE


LOCAL P1 AS TPoint;P1.init(1,2,3)


with an empty main file called Test.gbas (Project Test). The compiler kept throwing an error on the creation of P1 (LOCAL P1.....line).
If I move this line to the main file I get no error. Therefore I assume that I can't declare variable of a type in an attached (referenced file) ??
Does that make sense?
Thanks for the help. I hope I can proceed now.
Matthew                     
#12
Tried that - didn't seem to work.
I tried changing my attack and as I only want to deal with 3D points
Code (glbasic) Select
TYPE TPoint
Loc[]
FUNCTION CreatePoint:x,y,z
self.Loc[0] = x
self.Loc[1] = y
self.Loc[2] = z
ENDFUNCTION
ENDTYPE

LOCAL P1 AS TPoint

But the compiler errors the "LOCAL P1 AS TPoint" line with (25) error : command not inside function or sub
#13
Are they allowed.
For instance I want to do something like this
Code (glbasic) Select

CONSTANT MaxDims=3

TYPE Point
     Loc[MaxDims]
ENDTYPE

.....................................
//then later do

LOCAL P1 AS POINT
.......................................
FOR i = 0 to MaxDims
      IF P1.Loc[i] ................

Now I know this code won't work but the compiler issues an error for the Loc[MaxDims] line
Any answers greatly appreciated
Thanks
Matthew
#14
Just to confirm that the live update crashes on Win 7 Home Prem. I downloaded the install from post one again, however this is still version 10.001. When I do a web update it tells me version 10.013 is available so I say update. Update runs and lists what it is doing eg read info file etc. When it gets to "Installing Update", it crashes and closes with no further messages except Windows message saying that the program has stopped working.
#15
OK tried with the ANDROID_SWT variable set however same error. Message says something about not being able to start the java VM and dex failing (same as quoted previously)
Thanks
Matthew