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 Discussion / 3D model collision (need help)

Author
Message
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 25th Dec 2002 06:10
Hey DB gang, and happy holidays to you.

I have a problem and I'm sure its been discussed a million times before, but since I can't search these forums and don't feel like wading through pages of topics, I am going to ask myself.

I created a very very simple object/map in 3D Max, in which it consists of one scaled box (very short, but rather long) and then another scaled box which extrudes from the first one (creating a sort of pathway). However, after exporting the object to DB in 3DS format, my 'character' will detect object collision no matter where he is as long as he is in the range of the 3D object, even if there is not actually any part of an object there. Please look at my screen shot to see what I mean. The box is suppose to drop whenever there is no collision present, and yet it sticks there when it is over the BLACK (empty) of the object).

Is there a simple fix to this? Thanks in advance, I have had this problem for years now and just figured I'd ask now.

Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 26th Dec 2002 05:22
What do you mean, "in range"? Also, what type of collision detection are you using? And finally, what happens when the player IS colliding with one of the boxes?

I'll give you a hand if I can, but Doc not too bright - Doc not understand yet...

"I am a living, thinking entity who was created in the sea of information."
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Dec 2002 05:40
Ok I think this is what he is talking about. He wants the green to act as a platform, and if the yellow box is not on the green, he wants it to fall down. Get it?

I think your problem is the object isnt weighted at all, or maybe that you didnt position the objects up in the air (position object x,x,Y,z)

Id try moving the objects up, and adding some weight to the box.

I hope I got the explaining part right You want the green a platform, and if the yellow isnt on the platform then if falls down. Right?

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 26th Dec 2002 06:22
Oh, yeah - I know what he's (she's?) trying to achieve, but from what's been said, I can't really put my finger on what the problem might be?

Not understand platforms!? Ha! Doc not that stoopid!

"I am a living, thinking entity who was created in the sea of information."
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 26th Dec 2002 08:04
Alright, I made a very nice, very simple example as to what I am talking about. Please download from http://mogwai.volcanicsoft.com/sample.zip . It is less than 2 KB big and only contains a simple 3D platform-like model and the code thats causing me problems (short). I have a cube that you can move around, and I do have a gravity-like force in which the Y position decreases by X amount of units each time it is not colliding with the object, otherwise it equals the previous Y value. Its rather had to explain, but with the demo I made it will show you what I'm talking about instantly! The box drops from the sky and hits the object and stays there, but then when you walk even if you walk over a black area in the reach of the full object you will stay in the air. Just use the arrows to move. Please help me if you find a solution. Thanks again.

Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 28th Dec 2002 02:32
Okay, here's the problem:

By default, DarkBasic sets its collision type to boxes, which means that it simplifies an object into a box whenever it tests for a collision. This is a fairly fast way to test for collisions but, when an object isn't a perfect box, it can be inaccurate.

What you need to do is set the collision type for you objects to polygons. This tests collisions without simplifying anything, checking each polygon in each object for a collision. It's much slower than box collision, but has the accuracy that you're looking for. Check the help file for the syntax.

Hope this helps!

"I am a living, thinking entity who was created in the sea of information."

Login to post a reply

Server time is: 2024-04-25 09:51:43
Your offset time is: 2024-04-25 09:51:43