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 / Call me lazy, but I just can't be arsed ...

Author
Message
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Sep 2003 04:34
... to spend half an hour or so making a complex enough program to test out polygon collision properly. Is it still knackered in update 5, or does it work now? I have an old game in progress that's been waiting for around 6 months in a semi complete state, waiting for the day polygon collision will actually work.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 13th Sep 2003 11:52
I think its code-it-yourself time.

This won't be an easy one to do, but I thought of one possibility

1. Get memblock data for the object you want to check
2. For each triangle in the first object, use INTERSECT OBJECT starting at the first vertex of the triangle, and going to the second one.
3. Repeat until you have done INTERSECT OBJECT (checking against the second object) for each line in the triangle
4. Repeat for all triangles in the model

This method does have a few problems though:

1. If a polygon from the second object intersects the first object, but doesn't "cut" any of the edges of any triangles, no intersection will be found.
The solution would be to repeat the check, but swap the parameters (second object as the first object and vice-versa)

2. It probably won't be that fast. You could probably add in some cheats if you didn't mind foregoing some accuracy (only check two lines in a tri, only check every other tri)

randi
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 13th Sep 2003 13:24
Rob,
Have you ever had any problems with 'intersect object' working when the object has been scaled?

I'm having a problem and it seems to be why.
When I don't scale it, their is no problem.

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Sep 2003 14:53
Arrghh, memblocks scare me though. Most of the collision could be considered 2D though, and it's with space ships which are fairly rigid. I could code it all by considering the object extremities and just checking for 2D line intersection. That'll be nice and fast. The only problem is tackling the huge motherships. I have small craft about 1/100th the length of the motherships, and they're by no means uniform.

Back to the drawing board I reckon. Maybe if I model the ships with cubes, spheres and other easy collision objects in mind, I'll be able to come up with some speedy shortcuts.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
M00NSHiNE
22
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 13th Sep 2003 15:58
Memblocks scare me too, and Im finding it hard to concentrate on what your saying because im distracted by Randi's picture above. Please make it bigger Randi. Please.

"It's amazin' what you can do with a computer and access to t'internet"
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Sep 2003 16:40
It's not so much memblock phobia - it's phobia of having to figure out the structure for the specific file format. I think the documentation under make memblock from mesh or whatever should then explain how the info in the memblock would be structured. But eh, I'm sticking with my easy collision 2D method thing. Easier, I'm thinking.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 13th Sep 2003 17:18
@Randi: that was in the bugs section, if you resize the object then make it into a mesh and back to object then intersect object works, if you just resize then it doesn`t (not correctly anyway) the only problem with this is that you can`t resize animated objects and retain the animation, cheers.

Mentor.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Sep 2003 20:12
So theoretically, object intersect calls from each vertex of an object to another object could be used to perform manual poly collision.

Our of interest, if you have say a sphere, and you try to detect collision using object intersect and from a point inside the sphere to another point inside the sphere, will it detect collision? Or does the line have to pass through a face?

Insiiiiiiiiiiiiiiiiiiiiiiiide!
randi
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 14th Sep 2003 05:04
Well...
I went and scaled the model, in the modeling software, so I don't have to do it in the game, and I am still having problems.
It works fine when it really is being intersected by the object.
It's just that it sometimes says that their is an intersect when their is not.
Plus it detects when another object, that is not even being tested for, intersects.

I have come to the conclusion that 'intersect object' is not perfect.
But it's ok.
For what I am using it for, it doesn't have to be.

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Sep 2003 12:33
@Fallout..any point inside will detect a collision, collision is based on the volume, not the faces intersecting, would be nice if they had a face-intersect collision option as well as the normal volume based one, (I didn`t say that ..some serious bug removal is higher on my priority list), besides, you can use intersect object to make a fast slide collision from inside DB anyway.

Mentor.

Login to post a reply

Server time is: 2026-07-24 14:08:20
Your offset time is: 2026-07-24 14:08:20