Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / collision sparky not smooth

Author
Message
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 14th Oct 2010 15:06
OK i have been testing for a fps game and found that my camera collisions are not smooth enough.

when it collides with the walls it just snaps bak to the position.
check this code plzzzzzz


plz help with the sccamcol function.

ALLAH IS THE GREATEST
May he forgive me
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Oct 2010 19:42
Looking at the size of your objects I'd use floats for positioning, IE change this:


...to this throughout your code!:


Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 14th Oct 2010 21:35
@baxslash thnx for the reply the smoothness is now good but two new problems arise.

1.camera doesn't slide anymore.
2.i can see behind the boxes i.e. the camera just renders the wall from inside when collided.

any fixes plz.

ALLAH IS THE GREATEST
May he forgive me
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Oct 2010 21:59
Post your updated code?

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 14th Oct 2010 22:05
that is the code that you changed and it was same problem as before.

ALLAH IS THE GREATEST
May he forgive me
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Oct 2010 00:04
hmmm, sometimes we forget that we changed something...

Just in case, post it anyway

I'm not lazy, just practical

Quote: "same problem as before"

...almost never the case

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 15th Oct 2010 19:25
i didn't work in the code.only the "#" are included.

any ways here it is


plz help me.

ALLAH IS THE GREATEST
May he forgive me
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 16th Oct 2010 03:35
whats with //looooooooooooooooooooooooooop?
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Oct 2010 14:05
Quote: "ox=camera position x(cam)
oy=camera position y(cam)
oz=camera position z(cam)"

Anything related to positioning the object will also need to be a float.


...try that, untested.

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 16th Oct 2010 15:22
@baxslash.

the problem is not with the smoothness now , but the rendering range of the camera is not good enough.

If i stand near a the wall(collided) the camera goes inside the wall and renders the opposite normal of the opposite wall to the wall i collided with.

the near clip is going into the wall any ideas or code

ALLAH IS THE GREATEST
May he forgive me
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Oct 2010 17:50 Edited at: 16th Oct 2010 17:52
Quote: "SET CAMERA RANGE Near Value, Far Value

SET CAMERA RANGE Camera Number, Near Value, Far Value"


I find most answers by doing a windows explorer search of the help folder in DBP folder, in this case you could have just typed "camera"

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 17th Oct 2010 10:06
i did that baxslash ,but i don't know have you actually made a fps before?

if you have then can you plz tell me how did you make a gun shot exactly at the cross fire direction.like from the gun to the point.

ALLAH IS THE GREATEST
May he forgive me
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Oct 2010 14:54
You make a limb and offset it from your character, then insect between your player and the offset limb.

Theres a tutorial somewhere.

Login to post a reply

Server time is: 2026-07-22 12:41:31
Your offset time is: 2026-07-22 12:41:31