View Full Version : Interparticle collisions?
liltbrockie
08-12-2008, 12:48 PM
Not sure if this is easily possible or not but can ICE work out interparticle collisions?? say if i wanna chuck a load of instanced rocks at the floor... any way of making them stay apart realistically? I know there is the neighbouring particles force but thats not really giving the right effect.
ThE_JacO
08-12-2008, 01:02 PM
There's the whole particles rigid body stuff, and it take into account interparticle, including actual shape of instanced objects I think.
So, yes, if you want to throw rocks at something you can.
liltbrockie
08-12-2008, 01:53 PM
There's the whole particles rigid body stuff, and it take into account interparticle, including actual shape of instanced objects I think.
So, yes, if you want to throw rocks at something you can.
OH yeah!!!!!!!!
so what am i doing wrong here then?? seems that my box collisions are based on its bounding box or something :-(
T.I.M.
08-12-2008, 04:12 PM
Wow! Yes you can do a lot with ICE but we still have a lot of limitations.......
JamesCG
08-13-2008, 09:46 AM
I'm following along with a DT tutorial... I tried filling a bowl with ICE particles and it seems that the ICE RB simulation does not account for actual shape. The ice particles would 'hit' where the top of the bowl would be. Guessing you go with the traditional RB simulation instead of ice if you want actual shape to be used?
It's very fun learning about ICE, I'm really liking 7.0
*update*
After a second looking at the manual (RTFM I know) I found this under the ICE RB Simulation Help section
"The obstacle geometry. The obstacle collision is approximated to the convex hull of the geometry."
Cheers,
JamesCG
T.I.M.
08-13-2008, 11:59 AM
I found this in the documentation:
"For doing non-convex objects, you can decompose the object into proxy geometries, group them, and then use the group as the obstacle."
But I don't think this will work in all cases.
JamesCG
08-13-2008, 12:24 PM
T.I.M.
Nice find. I had the same idea but I ended up with 20+ piece of geometry and the ice tree was getting crowded..nice to know I can just grab a group of polygons to help with non-convex objects. Gonna give this at try later tonight.
~JamesCG
liltbrockie
08-13-2008, 12:59 PM
gawd sounds like theres no easy solution to this :-( keep trying guys and post a scene if you manage to do this!
ThE_JacO
08-13-2008, 01:54 PM
works fine here.
use 5 grids for obstacles to create a box, see if it works. It should.
If it doesn't there's some other issue.
liltbrockie
08-13-2008, 03:05 PM
works fine here.
use 5 grids for obstacles to create a box, see if it works. It should.
If it doesn't there's some other issue.
:-S long way round huh? so you cant just use a cube and cut the top off.
And I cant move some points around on a grid and have it reflect those changes?
The collision only works on grids?
ThE_JacO
08-13-2008, 03:14 PM
:-S long way round huh? so you cant just use a cube and cut the top off.
No, that's not convex.
It's a limitation of the current engine for performance reasons afaik.
And I cant move some points around on a grid and have it reflect those changes?
The collision only works on grids?It doesn't work only on grids, it works on anything, but it will approximate non convex shapes to their closest convex hull.
Take a sphere and move a few points along the normal by however much you want, You'll see collisions will be fine on actual shape there.
However if you take a shape like a glass you have to reproduce it by its individual components forming convex shapes.
JamesCG
08-13-2008, 03:44 PM
Well I've attached a scene to this post where I broke apart a polygon bowl into pieces so some RB Ice particle/instances would pile up inside. Seems to work pretty good.
Scene:
http://www.centerstage3d.com/scenes/ICE_BowlFilled.scn
~ JamesCG
franky
08-13-2008, 04:04 PM
nice example James... thanks for sharing...
liltbrockie
08-13-2008, 04:09 PM
ok cool i get it :-)
JamesCG
08-13-2008, 07:04 PM
nice example James... thanks for sharing...
No problem. With the release of 7 and ICE there seems to be this huge surge in sharing going on. Between here, XSIBase and the XSI mailing list helpful tutorials, discussions and compounds are springing up all over. Makes the XSI community look really good and it feels good seeing all the helping going around.
~ JamesCG
Stereo
08-14-2008, 08:14 PM
i made a cube with a hole in it and put a passive rigid body on it, with actual shape,
you can take a rigid body properties from the explorer into ice,
it can be plugged into simulate rigid bodies/obstacle1/geometry1 but it doesnt work...
maybe someone can figure out hot to make that work?
ThE_JacO
08-14-2008, 11:23 PM
The RBD properties aren't the same of what ICE uses for particles RBD, they aren't shared.
Also a cube with a hole in it isn't convex, so it won't get you what you want in ICE.
streaker
08-15-2008, 09:03 AM
Maybe someone who know scripting well can write a piece of code that convert (move/break apart - don't know how to write this) polys to objects and group them together ?
liltbrockie
08-15-2008, 09:38 AM
maybe XSI 7.1 will support concave meshes for rigid body particle collision cos that would be cool!
T.I.M.
08-15-2008, 10:34 AM
Maybe someone who know scripting well can write a piece of code that convert (move/break apart - don't know how to write this) polys to objects and group them together ?
Here is a script.Select the components you want and disconnect them.Select the object and apply the script.
// separates poly islands into objects
var oldP = new String (GetValue("preferences.scripting.cmdlog"));
SetValue("preferences.scripting.cmdlog", false, null);
//SetValue("preferences.scripting.cmdlog", true, null);
var oSel = getValue("selectionList");
var oSel = oSel(0);
var oObj = oSel.ActivePrimitive.Geometry;
var oPoly = oObj.polygons;
i = 0;
var oColl = new ActiveXObject("XSI.Collection");
while(oPoly.count>0) {
var oP = oPoly(0);
pCount = -1000;
pCountOld = -9000;
while (pCount != pCountOld) {
pCountOld = pCount;
var total = oP.GrowNeighborPolygons();
pCount = total.Count;
var oP = total;
}
var aP = new Array();
for(j = 0; j < oP.count; j++) {
aP.push(oP(j).index);
}
pEX = oSel.name + ".poly[ " + aP + "]";
var oExtract = ExtractFromComponents("ExtractPolygonsOp", pEX , oSel + i, true, siImmediateOperation, siKeepGenOpInputs, null);
logmessage (oExtract(0));
oColl.add (oExtract(0));
FreezeModeling(oSel, null, null);
selectObj (oSel);
var oPoly = oObj.polygons;
i++;
}
var aColl = new Array();
for(j = 0; j < oColl.count; j++) {
aColl.push(oColl(j));
}
MoveCtr2Vertices(aColl, false);
FreezeModeling(oColl, null, null);
logmessage ("Done");
Application.Preferences.SetPreferenceValue ("scripting.cmdlog", oldP) ;
liltbrockie
08-15-2008, 10:42 AM
Here is a script.Select the components you want and disconnect them.Select the object and apply the script.
// separates poly islands into objects
var oldP = new String (GetValue("preferences.scripting.cmdlog"));
SetValue("preferences.scripting.cmdlog", false, null);
//SetValue("preferences.scripting.cmdlog", true, null);
var oSel = getValue("selectionList");
var oSel = oSel(0);
var oObj = oSel.ActivePrimitive.Geometry;
var oPoly = oObj.polygons;
i = 0;
var oColl = new ActiveXObject("XSI.Collection");
while(oPoly.count>0) {
var oP = oPoly(0);
pCount = -1000;
pCountOld = -9000;
while (pCount != pCountOld) {
pCountOld = pCount;
var total = oP.GrowNeighborPolygons();
pCount = total.Count;
var oP = total;
}
var aP = new Array();
for(j = 0; j < oP.count; j++) {
aP.push(oP(j).index);
}
pEX = oSel.name + ".poly[ " + aP + "]";
var oExtract = ExtractFromComponents("ExtractPolygonsOp", pEX , oSel + i, true, siImmediateOperation, siKeepGenOpInputs, null);
logmessage (oExtract(0));
oColl.add (oExtract(0));
FreezeModeling(oSel, null, null);
selectObj (oSel);
var oPoly = oObj.polygons;
i++;
}
var aColl = new Array();
for(j = 0; j < oColl.count; j++) {
aColl.push(oColl(j));
}
MoveCtr2Vertices(aColl, false);
FreezeModeling(oColl, null, null);
logmessage ("Done");
Application.Preferences.SetPreferenceValue ("scripting.cmdlog", oldP) ;
Not entirely sure what im sposed to be seeing here... i apply the script to a sphere say for example... and i get what looks like another sphere in the explorer but nothing displayed on screen? explain what this script does again please.
streaker
08-15-2008, 11:37 AM
Hi T.I.M - thanks for the script, but... (here's the interesting part :) ) I done exacly like you wrote -> disconect polys -> select model -> run the script and i get this message:
// ERROR : 2000 - Argument 1 (ConnectionSet) is invalid
// ERROR : 2001-MODE-ExtractFromComponents - Argument 1 is invalid
// ERROR : Invalid procedure call or argument - [line 41]
and after that get second object with disconnected polys (cuted out from oryginal)
T.I.M.
08-15-2008, 11:54 AM
Not entirely sure what im sposed to be seeing here... i apply the script to a sphere say for example... and i get what looks like another sphere in the explorer but nothing displayed on screen? explain what this script does again please.
First, you have to disconnect the object components from your chosen region by selecting the polygons or edges and using Model> Modify>PolyMesh>Disconnect Components and when you done with breaking the entire object on separate poly islands select the object and run the script.Something that I forgot to mention is that you have to freeze the object.
If you need each poly to be a separate object simply select all edges in the object and run Disconnect Components (but this is not gonna work with ICE)...
I hope this time is more clear !
P.S. And if the object is not very complex Why don't you use just Extract Polygones...
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.