PDA

View Full Version : How to add colision detection?



Airwolf
Apr 25 2002, 14:30
my model is completly made as far as viewing it goes, and i have textures if i can get them to work in oxygen, i need help with the collsion detection and shadow though, how do i do this? Kegetys your sled has collision detection right? how did you do that?

GFX707
Apr 25 2002, 17:17
Yeah, I really need to know this too as I am at this stage with my first model http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif

Kegetys
Apr 25 2002, 17:34
Add a new LOD level, named "Geometry" (right click on the LOD window), and to there place (a low detailed) model to be used for collision detection. Im not sure about shadows though.

GFX707
Apr 25 2002, 17:50
I am trying to create a basic sorta building with one room that you can run into....however when I create a LOD called Geometry and place the model into there it still doesn't work....I can run right through it and shoot right through it....all I am doing is copying the original model and simplifying it a bit, so would it have to be a different shape or something....? I am confused

Airwolf
Apr 25 2002, 23:20
when i right click on lod and click new, then click properties and choose geomerty, my entire model dissapears!

GFX707
Apr 25 2002, 23:32
I think that's just because it has changed to the geometry view....

Airwolf
Apr 25 2002, 23:50
ah, how to see it in geometry view?

GFX707
Apr 25 2002, 23:55
you have to add a low detail model to be used for collision detection....or in other words you have to make another model in that view

WKK Gimbal
Apr 26 2002, 00:31
For shadows, OFP just uses one of the lower LODs. It then flattens the model across the ground like a pancake http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

Airwolf
Apr 26 2002, 00:35
ok, i made the geometry lod, then i pasted my model onto that, saved and put it into the game, but i can still pass thought it, it floats when i shoot the ground below it though lol. Have i done anything wrong?

GFX707
Apr 26 2002, 00:41
I have the same problem http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif

Airwolf
Apr 26 2002, 01:11
gimbal? kegetys? help!!

WKK Gimbal
Apr 26 2002, 01:38
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Airwolf @<hidden> April 26 2002,03:11)</td></tr><tr><td id="QUOTE">gimbal? kegetys? help&#33;&#33;[/QUOTE]<span id='postcolor'>
Well, it&#39;s not easy to guess what you are doing, but remember that polygons are 1-sided. If you want collision detection inside a house, you must make a model that faces inwards as well as one that faces outwards. I&#39;m sure that will help.

Airwolf
Apr 26 2002, 01:51
ok, i copyed the model pasted it and reversed the polys, still no collision. pass right through.

WKK Gimbal
Apr 26 2002, 03:27
I noticed that all collision shapes are closed objects. Are yours too?

Airwolf
Apr 26 2002, 05:12
i will have to check that out, is there a way i can make the program make a low res model? even maybee some bounding boxes to use as a collision detection?

WKK Gimbal
Apr 26 2002, 05:18
OK, here&#39;s the deal:

Every collision shape must be closed, i.e. not have any open holes in it. Boxes can be used for most as they can be very simple. Each seperate object must then have a selection class named "ComponentXX" where the two X&#39;s is a number, like:

Component01
Component02
etc

If they are not part of a selection they will not work.

Be careful not to make collision shapes that are too complex. There is bigger risk that the model will be caught up in other objects. Make it something convex.

Suma
Apr 26 2002, 11:54
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Every collision shape must be closed, i.e. not have any open holes in it. Boxes can be used for most as they can be very simple. Each seperate object must then have a selection class named "ComponentXX" where the two X&#39;s is a number, like:
[/QUOTE]<span id='postcolor'>

If I am not mistaken, there is some support to help you with this. In the original Objektiv (the one I wrote) they were two tool groups in the Structure menu called Topology and Convexity, with particulary helpful commands Find Non Closed, Find Components and Component Convex Hull.

While those tools will not do all the work for you, they may make it a little bit easier. You still have to provide very simple geometry, but it will help you to make it closed and named.

Erex
Apr 26 2002, 16:02
One practical advice (not sure if this function is included):
in everygeometry use as last step Component Convex Hull.

Add then chcek out if everthigs Ok.
It should make components from your simplified model (convex parts)

GFX707
Apr 26 2002, 18:53
Ok, I have done this and now my model is stopping bullets both from the inside and out, but I can still run through it

anything else I need to know....?

Airwolf
Apr 27 2002, 00:28
Ok, i think i have done collision detection, i made a plain box, when i shoot it now it spins around, when i walk into it it usually explodes or sort of stops me, is there anyway i can make the model heavier? i assume thats why its spinning around and exploding when i touch it.

Suma
Apr 27 2002, 07:38
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> is there anyway i can make the model heavier[/QUOTE]<span id='postcolor'>

Switch to "Geometry" LOD, select all points. Total mass whould be visible in Mass window (if you do not see Mass window, open in from Window/Mass). You can change it by editing the value. When you want to change mass distribution later without affecting total mass, select only some points and make them hevier of lighter. This way you can edit angular inertia of the model.

Airwolf
Apr 27 2002, 20:06
ok, let me get this straight, in order to do collision detection i need

a. Model
b. Seprate Geometry model with no open spaces? so that when i click find non-closed nothing turns red?
c.Mass adjustment
d.component convex hull

Did i get it right?

Suma
Apr 28 2002, 15:29
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">a. Model
b. Seprate Geometry model with no open spaces? so that when i click find non-closed nothing turns red?
c.Mass adjustment
d.component convex hull
[/QUOTE]<span id='postcolor'>

This is correct. I would add that each component of component convex hull should be named ComponentXX. This is done automatically when using Component convex hull function. This function should also close all non-closed components. Whilie it works often, but sometimes it does not, especially with more complex geometries - in that case you have to correct the results manually.