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 / Help with collisions

Author
Message
JohnFP
20
Years of Service
User Offline
Joined: 5th Feb 2004
Location: Maryland
Posted: 15th Feb 2004 19:57
Ok, I got my collision down but I am having a very strange problem. As you can see I am doing a loop and when the object (light ball) moves and collides with object (object3) (mirror) it rotates the ball such that it reflects off the mirror with the correct angle (reflect1 which is calculated off the angle of the mirror). My problem is the if I do not put a move in before the next if statement that checks to see if the ball hits the second object (object4) it will not get a collide return. I have the two additional moves in the code below remmed out. If I unrem them the second and thus the third collision works. I tried to set global collision off then on again to clear where the collision is being stored but I cannot figure out why a move has to preceed the second and third collision detection. All 15 balls work off the first mirror but not the second unless I unrem the two moves that are remmed out.

Is there something that has to happen in order to get a second collision detection? Maybe some registry clear?

Thanks in advance,
John

PS: If I knew where or how to save the object .3ds files I created on this forum I would post the entire program such that you could see it in action. Compiling would not allow you to alter and play with the code.
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 15th Feb 2004 20:26
well, i have an answer to your last question and a question of my own to ask,
answer: if you created the object in db, then i don't know how to save it, but if you have a 3ds file you can do 1 of two things. you can put it in a zip folder and upload it to almost any site, like geocities. or you can open it in milkshape3d (find it on google, it's shareware) and save it as an x file, and post the code it gives you (i'm not sure that will work though, as it's long and has strange characters and tons of spaces)

my question: i'm not an expert with collisions, but do you know how to detect collisions between an object and a matrix?
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 15th Feb 2004 21:56 Edited at: 15th Feb 2004 21:57
Greetings,

A less-hassle solution that you might consider is using our collision DLL. You can make ellipsoids (and spheres) collide against dynamic meshes and even with each other! All simultaneously.

The link to our website is below.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
JohnFP
20
Years of Service
User Offline
Joined: 5th Feb 2004
Location: Maryland
Posted: 16th Feb 2004 05:14
Ok nuclear glory, this is the second time I have seen your post/adv.

Let me ask you a question, does your Ray-Cast command allow the visibility of the laser light? That is, can I see the laser light from the gun to the target as if in a fog? Then how could your software handle a correct reflection (angle) off of a shiney object like a mirror or metal? Answer me these and you may have a customer.

Peace!
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Feb 2004 06:06
Quote: "does your Ray-Cast command allow the visibility of the laser light?"


The ray-cast command does not cast light or do anything graphical. It tells you precisely where an invisible ray intersects a mesh object and gives you the 'normal of contact'. From this info, you yourself should be able to code the graphics that make the "beam" of light to the point of contact. In the demo version of the DLL, a textured-plain was used to simulate the laser sight on the wall. It is positioned and angled using the data from the raycast system.

Quote: "Then how could your software handle a correct reflection (angle) off of a shiney object like a mirror or metal?"


The raycast system provides the 'contact normal' of the surface that was impacted. You should be able to use the normal to cast further beams, make rebouding effects, etc... The normal is also used to align the laser decal to the surface of the wall in the demo.

To do something like a reflection, you would do some steps like this:

1) Cast a ray into your mesh
2) Get the contact point and contact normal of the hit (if any)
3) Calculate the rebound data using the feedback from step 2
4) Cast another ray from the point of contact using the rebound data from step 3

and so on and so forth...

In short, the DLL allows you to quickly get information for complex collision scenarios.

Then the limits are only your imagination (and computer power)

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com

Login to post a reply

Server time is: 2024-11-26 05:29:25
Your offset time is: 2024-11-26 05:29:25