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 / I think I'm dumb - Intersect Objects

Author
Message
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 15th Aug 2006 00:54
I'm trying to use the intersect object command and I fully understand it returns a distance to the collision between the camera and the object being tested (if it exists.)

For the life of me I can't figure out what to do with the distance.

I need the actual location. They have commands such as "OBJECT COLLISION CENTER X" (and Y,Z) for this of your colliding objects however I cannot figure out how to calculate the exact position of this collision using the intersect command. I'm thinking newvalue is along the path but how can I use the hypotenuse distance on 3 different equations?

Anyone able to help? I looked up other examples however I'm not getting them. They just do it, and don't explain it.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 15th Aug 2006 01:09
I remember someone posted a tutorial about shooting using the intersect object command. It was either on this board or the newcomers. That post should help.

Mysteries Surround You
Trinita
20
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Italy
Posted: 15th Aug 2006 01:18
Just use Sparky's DLL. You'll find it here:

http://forum.thegamecreators.com/?m=forum_view&t=31051&b=5

This is the best collision for DBPro, and it's Free!!

"An eye for an eye will only make the whole world blind."
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 15th Aug 2006 01:30 Edited at: 15th Aug 2006 01:31
Here's an example that I just wrote for this post. I'm not sure about the Y value but the X/Z values should be correct. Move using the arrow keys. Oh, and intersect object does not work only for a camera, it can also work with an object too! It just checks for collision against a certain object. If the 3D line from the first coordinates to the seocnd ones collides with the object you specify, then the distance is returned. Anyway, here is my quick example:




RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Aug 2006 02:55
Quick and dirty, position an object or camera at the starting position of the intersection ray, move it the distance returned from the intersect object function, and record the object/camera's new position in variables. This new position is the position of the intersection check.


But yes, you should use Sparky's dll as its much faster and returns a tonne of more info, including the xyz position of the intersection, the xyz angle of te normal of intersection, the bounce direction from the intersection, and the sliding collision position if need-be.


Projects: Online CTF Game | Newcommer's Guide to FPS's
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 15th Aug 2006 03:15
Wow thank you all. I will be checking this out all night

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 15th Aug 2006 21:42
Sparky's seems great.

Today, now thinking clearly I thought of a simple solution. Does this work or seem logical?

Make a dummy object. Hide it.

1.) Use the Pick Screen to get my 3D position.

2.) Intersect at a terrain, get the distance.

3.) Make an object at the position of the camera.

4.) Point the object at the distance that the intersect generated.

5.) Move the object the distance from the intersect command.

6.) Read the objects position.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 16th Aug 2006 01:56
Try this old snippet i made, it should clarify intersect object usage and how to get coords of the hit spot of the intersect ray


Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 16th Aug 2006 03:15
Lol.

Uncle Sam
Nvidia Geforce 7600 GS 256MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 768MB RAM
Need particles? Click here!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 16th Aug 2006 22:06
You've made one useless comment in so many newcomer threads Uncle Sam, so you can stop now.


Oh and MatriX Your not dumb I had problems with that too

Applyby has Flies in his Eyes.
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 17th Aug 2006 07:19
Don't you get it?

When helping a noob in the newcomers board, one does not give out a snippet pages long.

Quote: "You've made one useless comment in so many newcomer threads Uncle Sam, so you can stop now."


Hmm, that does not seem possible, one post in many threads?

Uncle Sam
Nvidia Geforce 7600 GS 256MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 768MB RAM
Need particles? Click here!

Login to post a reply

Server time is: 2024-09-25 07:24:41
Your offset time is: 2024-09-25 07:24:41