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 - a6n0rma1

Pages: [1]
GLBasic - en / Re: 3D Camera Collision Problem
« on: 2013-Jun-14 »
It worked! I feel so retarded now. I tried everything except from the simplest and most evident solution! Thanks a ton.

GLBasic - en / 3D Camera Collision Problem
« on: 2013-Jun-13 »
I'm making a silly little game, based on the 3dmaze sample. It creates a random maze, populates it with sprites and 3dmodels and let's you walk through the dungeon. I changed the deafult camera to enable moving with w,a,s,d and mouse looking on x and y axes. I added kanonet's super lighting lib and his quick math library. Everything is working fine, except i can't make a proper camera collision.

Code: (glbasic) [Select]
x_old = Cam_x//store current x camera value
z_old = Cam_z//store current z camera value

IF X_COLLISION(0,0,sz/4,Cam_x,sz/2,Cam_z)//check if the camera collides with any of the walls. walls have id 0
Cam_z = z_old
Cam_x = x_old
collision = 1
collision = 0

IF KEY(17)// forward 'w'
INC Cam_z,qSIN(phi_xz)*Cam_Speed
INC Cam_x,qCOS(phi_xz)*Cam_Speed
IF KEY(31)// back 's'
DEC Cam_z,qSIN(phi_xz)*Cam_Speed
DEC Cam_x,qCOS(phi_xz)*Cam_Speed
IF KEY(30)// left 'a'
INC Cam_z,qSIN(phi_xz-90)*(Cam_Speed-0.2)
INC Cam_x,qCOS(phi_xz-90)*(Cam_Speed-0.2)
IF KEY(32)// right 'd'
INC Cam_z,qSIN(phi_xz+90)*(Cam_Speed-0.2)
INC Cam_x,qCOS(phi_xz+90)*(Cam_Speed-0.2)

I then print the collision value. Whenever i am close to a wall it get's to 1 as it should, but Cam_x and Cam_z don't get constrained to the values they had before the collision occured and i simply pass through the wall. I must be doing something wrong, but i can't figure out what. Any ideas/help would be appreciated. I tried using the 3D entity system for collision checking. I created a sphere and placed it to where the camera is. I am doing an EntityCollisionSlide(ball, 0, Cam_x, Cam_y, Cam_z) and then Cam_z = z_old  and   Cam_x = x_old, but still to no avail. The camera, keeps passing through the walls.

Bug Reports / Re: INPUT$
« on: 2011-May-26 »
Thanks for the quick answer. Silly me, i was unaware of the beta version+hotfix. Now everything is working like it should.

Bug Reports / Re: INPUT$
« on: 2011-May-25 »
Any ETA as to when the INPUT bug will be fixed? I am still having it with GLBasic version 9.040 and it is hindering development of my text adventure game. Thanks in advance.

FAQ / Re: Books
« on: 2011-Jan-19 »
Thanks for the awesome books MrTAToad! They serve as invaluable references. I just bought them all in .pdf format. I suggest anyone who is serious about GLBasic development and wants to delve deeper, also buys them. They are ridiculously cheap in contrary to what they offer! Keep up the good work. You got yourself a supporter and Tenebra Studios will as of now be using your books to deliver even better products!

Pages: [1]