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.

Dark GDK / Help with intersect object

Author
Message
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 24th Apr 2008 03:30
Can anyone give me an example of how dbIntersectObject works... I'm a little confused...



This is what i have right now... I don't think it's right and I'm not 100% sure how it works... Can anyone explain...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 03:54
It RETURNS the distance from the starting point that it hit something. You actually want to "Aim" PAST where your object 2 is... ... think of it as a raycast... you shoot your laser, and if it doesn't hit anything ok.. if it does, you should know how far away it was from ... in this case your camera.

I'm pretty sure thats how it works.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 24th Apr 2008 04:09
I'm wanting to do polygon detection between Object 1 and Object 2 (I'm sure you've already heard this)... How would I go about doing that?

I'm having trouble understanding what the camera has to do with this and distance in reference to the specified object... It's a little confusing...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 05:00
In your code snip you used the camera position for the starting point of the "Ray cast". Hang on... let me verify if intersect works how I think...

Quote: "dbIntersectObject
This command will return the distance to the point of intersection between two coordinates, in reference to the specified object. Use this command to project a line from your current position to a destination to determine whether a collision will occur with an object. Ideal for bullet calculations and fast manual polygon collision.

Syntax
float dbIntersectObject ( int iObject, float fX, float fY, float fZ, float fToX, float fToY, float fToZ ) "


and.... I think you actually want this:


Quote: "dbObjectHit
This command will return a one if the two specified 3D objects hit each other. If the second object number is set to zero, the number of the object hit by the first object will be returned as an integer value.

Syntax
int dbObjectHit ( int iObjectA, int iObjectB )
"


First raycasts from point a to point b. if it intersects with a poly, you get back the distance from point a where it smacked into something.

The latter - just tells you if two objects hit. Does this help at all?

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 24th Apr 2008 05:04
Hey Jason, do you have Xfire?

I don't need an oven to make my cookies.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 24th Apr 2008 05:15
I now have a better understanding of dbIntersectObject...

But the reason I'm not using ObjectHit is because i tried it before and it simply does not work... I don't know if the detection is slow or what but it does not work... it always, always returns a goose egg...

What is your suggestion at this point? Should I use intersectobject?

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 05:35
I THINK you should use sparky's dll. He has a version for DarkGDK, and its much faster than intersect etc anyways.

You'll have to hunt for there download - its in here somewhere - I never remember to bookmark the link. Search for paul johnson, sparky dll darkgdk etc.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 24th Apr 2008 06:19 Edited at: 24th Apr 2008 06:22
The latest version of Sparky's I could find is 2.04 that is for VS2005... I dunno if it works in 2008 and I tried it but got this error...



How about Tobi's collision detection? i tried using it but I dunno how to use it... What might the code be for my specific situation... You know object1 colliding with 2...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Apr 2008 07:16
You Should put that file in the DarkGDK LIB directory - so its automatically in the search path the linker uses, otherwise project->properties->linker->Input->AdditionalDependancies Put the FULL PATH and FILENAME to where your SC_Collisions.lib file is on your system.

I haven't used Tobi's code - I have seen his work though - and that gives him credibility as far as I'm concerned.

Tired...must sleep... one or two.. more... posts ...

@Zuka - no I don't have xfire.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 24th Apr 2008 07:31 Edited at: 24th Apr 2008 07:34
Thanks... And you go and rest... Where I live we have central time and it's only 10:30pm...

And... uh... I believe the thread that Zuka resides in is called "Networking"... I'll inform him of your lack of Xfire if you haven't already...

EDIT: Oops Zuka does have a post here... Must have missed it...

~~It's not who you are underneath, but what you do that defines you.~~

Login to post a reply

Server time is: 2024-09-29 17:20:42
Your offset time is: 2024-09-29 17:20:42