jm to shp Collision File Maker
Posted: Fri Dec 24, 2010 7:35 pm
Here is the program I've been using to make the ramps with. Well, I shouldn't say this program exactly, Servatis translated the logic into C# (in about 15 minutes!!) and so now you all can make complicated collision files for your models. Enjoy!
What it does:
It reads the .jm file and places a sphere of designated radius, friction, spring force, and dampening, at each vertex location for your model. The .shp file is put in the same directory with the same name as the .jm file.
A few things to remember:
-Radius sizes of under .5 typically don't work well
-Greater than 1000 spheres may cause lag
-Overlapping spheres don't harm anything
Settings:
-For riding on
--Radius of 1 to 1.5, Friction of 1.25 to 1.5, Spring Force of ~1000, Dampening of ~200
-For normal running into
--1 1 500 20 is fine
And now, a tutorial of how I would use it:
Finish your model that you want to place in game, and export it for use in game as is.
Now duplicate your model, so that we don't ruin the in game version in case you want to change it. Subdivide however many times you want, I usually subdivide quite a bit, up into the millions of vertices to get as tight a sphere mesh as possible. Obviously most computers can't handle this, so subdivide as necessary. You can also use loop cuts, ctrl + k, to divide your mesh up where needed. One technique I found handy too, was subdividing, removing doubles, and repeating this a couple of times, because subdivisions aren't always even all the way across a model.
Now, we need to remove doubles, we don't want too many spheres in a certain mesh if we don't need it. For ramps, or ride-able objects, I suggest using a limit of .250 or something like that. Change that number, then just hit 'rem doubles'. One more thing to remember, if you want to account for the spheres radius, re-size your new mesh to make up for that.
In this picture I'd be using a sphere radius of .25, and therefore have shrunk my 'collision' mesh in so that there lies a .25ft gap between the verts and it's coincident mesh.
Now all you do is export this mesh by a name other than what your in game object is, and then use the collision tool to make the collision file.
What it does:
It reads the .jm file and places a sphere of designated radius, friction, spring force, and dampening, at each vertex location for your model. The .shp file is put in the same directory with the same name as the .jm file.
A few things to remember:
-Radius sizes of under .5 typically don't work well
-Greater than 1000 spheres may cause lag
-Overlapping spheres don't harm anything
Settings:
-For riding on
--Radius of 1 to 1.5, Friction of 1.25 to 1.5, Spring Force of ~1000, Dampening of ~200
-For normal running into
--1 1 500 20 is fine
And now, a tutorial of how I would use it:
Finish your model that you want to place in game, and export it for use in game as is.
Now duplicate your model, so that we don't ruin the in game version in case you want to change it. Subdivide however many times you want, I usually subdivide quite a bit, up into the millions of vertices to get as tight a sphere mesh as possible. Obviously most computers can't handle this, so subdivide as necessary. You can also use loop cuts, ctrl + k, to divide your mesh up where needed. One technique I found handy too, was subdividing, removing doubles, and repeating this a couple of times, because subdivisions aren't always even all the way across a model.
Now, we need to remove doubles, we don't want too many spheres in a certain mesh if we don't need it. For ramps, or ride-able objects, I suggest using a limit of .250 or something like that. Change that number, then just hit 'rem doubles'. One more thing to remember, if you want to account for the spheres radius, re-size your new mesh to make up for that.
In this picture I'd be using a sphere radius of .25, and therefore have shrunk my 'collision' mesh in so that there lies a .25ft gap between the verts and it's coincident mesh.
Now all you do is export this mesh by a name other than what your in game object is, and then use the collision tool to make the collision file.