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.

Newcomers DBPro Corner / Object Collision questions

Author
Message
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 20th Sep 2003 06:31 Edited at: 20th Sep 2003 06:40
1. Is there a way to have the camera have collision detection?

2. Is there a way to simply add collision detection to the solid parts of an object? For example I load a building, and then can go into the building thru the door but cannot go through its walls or anything?

Or would I have to set object collision for each of its walls?

Or would I have to make invisible walls within the visible walls, the invisible walls having collision on? If I can't manipulate the building model walls by themselves
thanks
zzabb
21
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 20th Sep 2003 08:56
yes you can do all of those things if you wished

take your pick

then read the help files, look through the code section, read these boards, look through the 20 line contests and the tutorials, maybe buy the darkbasic programming manual and learn how to do it

half of knowing how to program is knowing what you want, the other half is the blood sweat and tears it takes to figure out how to do that

i don't mean to be mean or rude but...

there is a command for camera collision
there is a command for object collision
there is math for them times when the commands just don't do what we want

without knowing everything about your program the questions you asked are impossible to answer

My advice is free -
unfortunately you get what you pay for (-:
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 20th Sep 2003 23:30
Could you give the commands necessary to have an object loaded have object collision? And for the camera to have collision detection?

About my program: It is called Learn and I play around with it to learn more about DarkBASIC. The matrix is 10000 by 10000. It is first person. My current goal is to have object collision on any building loaded into the program without doing collision commands for invisible walls inside the object. My next goal will be to have a sword and you are able to swing it, which is off topic.

My movement commands, almost directly from the Binary Moon tutorial i think
Tazlin
21
Years of Service
User Offline
Joined: 18th Sep 2003
Location:
Posted: 21st Sep 2003 00:46
Hey Chris,
Try the code snippets section of this forum. I was browsing earlier and found lots of collision type snippets....
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 21st Sep 2003 00:58 Edited at: 21st Sep 2003 00:59
howver chris you should be aware that currently DBPro has no limb colision that is if u make an object and glue another object to it as a limb then its collision detection doesn't work....means that each wall will have to be a separate object..there other ways as well it's just 1 method.... BTW i think those snippets r DBC so depends on what chris has really....

-john D.
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 21st Sep 2003 19:13 Edited at: 21st Sep 2003 19:18
I have DB Classic.
Here is my main Do Loop.
I made the camera be inside of a box (took a while). The box will take the collision, instead of the camera, which might be easier?
My new problem is I don't know how to strafe using this method.

Also, if I have the player's collision detection be a box, would that mean it would not be smooth when you are at a wall.. as in, if you are moving into a wall, but facing a bit to the left, it will not move left if you are a box. Would making his object collision be a cylinder fix this?



There is a bunker model, a high cone, and a low cone in the program, and an attempt at making them have collision detection:

I'm not sure what I'm doing wrong. Would you please tell me what I need to do so that the player can
a. walk over the low cone
b. not be able to walk all the way up the high cone
c. be stopped at the big block of te bunker, and stopped at the little block


if you need my matrix info here it is
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 21st Sep 2003 22:27
I've been trying to figure this out all day. I looked through the code snippets and found a sliding collision method that I'm trying to get down. I successfuly implemented it into my program.

The problem is I can only do simple collision. And I have to manually select the coordinates of the 3d space that is being checked for collision. And I only know how to make one box coordinates per object, when sometimes I need two. And I can only do boxes when I want to be able to do a cone and stairs.

When I make my ultimate goal, a non linear 3d RPG, I don't want to be setting thousands of coordinates in my world like that. Is there a way to have the object/model automatically sense collision on the boundaries of its plains in 3d space?
Orbi
21
Years of Service
User Offline
Joined: 11th Sep 2003
Location:
Posted: 22nd Sep 2003 08:27
Me a newb too so don't trust me too much but there's a "set collision to polygons" command that comes in handy but takes up a bit more processor time.

I've had the collision problem for a few days till I worked it out. Then I had a sliding collision problem for a few more untill I gave up on pointless examples that never worked for me and wrote a sliding collision routine. It's probably not the most efficient but it works.

The basic logic:
if u hit a wall
1. Move your dummy object one step 10 degrees to the left.
1.1 if no collision, move the cam.
1.2 collides, then move the object back and try 10 degrees to the right.


Then u just make that loop till 90 degrees. Once it gets there it's important you exit the loop no matter what (a goto worked for me since I can't seem to find the equivalent of break). This is in case you get stuck in a corner. If u want it to slide smoother then just decrease the step angle to 5 degrees instead of 10, but 10 degrees looks pretty smooth to me.

The other problemo I had was the odd thing where some polygons do collide while other's don't depending on how i made the model...but that's another post.

Login to post a reply

Server time is: 2024-09-21 01:09:53
Your offset time is: 2024-09-21 01:09:53