jm to shp Collision File Maker
jm to shp Collision File Maker
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.
- Attachments
-
- shp file generator.rar
- (4.95 KiB) Downloaded 368 times
Re: jm to shp Collision File Maker
Sweeeeeet! I'll have to try it later on something to see how it is. Thanks man!
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: jm to shp Collision File Maker
A couple of tips -
If your polygons are all about the same size and close to square to begin with, I'd just subdivide less and skip the remove doubles step.
If you want to visualize how the object will come out, create a sphere of the appropriate radius and use dupliverts to place a copy of the sphere at each vertex.
If your polygons are all about the same size and close to square to begin with, I'd just subdivide less and skip the remove doubles step.
If you want to visualize how the object will come out, create a sphere of the appropriate radius and use dupliverts to place a copy of the sphere at each vertex.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 2303
- Joined: Wed Jan 02, 2008 5:53 am
- Team: your sister´s fan!
- Location: candy planet.
Re: jm to shp Collision File Maker
fuck yeah!
thanks a lot david!
i´ll test it as soon as i have time!
thanks a lot david!
i´ll test it as soon as i have time!
Massacre ftw!
the human stupidity and the universe are unlimited, and im not totally sure about the universe...
Re: jm to shp Collision File Maker
haha, Merry Christmas from me and servatismace-x wrote:fuck yeah!
thanks a lot david!
i´ll test it as soon as i have time!
Re: jm to shp Collision File Maker
How come the program doesn't write the shp file header (ie the number of lines)?
Does anyone know if there is a way to contract vertices in the direction of their normals? Regular scaling doesn't make the spheres fit the model properly
Does anyone know if there is a way to contract vertices in the direction of their normals? Regular scaling doesn't make the spheres fit the model properly
Re: jm to shp Collision File Maker
Answered my own question: Displacement map
Re: jm to shp Collision File Maker
Spheres are no good for riding on. But this thing is certainly good for making your basic contact collisions.
Re: jm to shp Collision File Maker
In the case of a rock, adds to the element I guess haha. Not too many smooth boulders out there.
Re: jm to shp Collision File Maker
Hey,
Someone can re-upload the program ? Cuz i need it, but the link on the first post don't work..
Someone can re-upload the program ? Cuz i need it, but the link on the first post don't work..
Re: jm to shp Collision File Maker
Up ! Please
I need it now... :/
I need it now... :/
-
- Posts: 6614
- Joined: Fri Feb 18, 2011 6:03 pm
- Team: me
- Location: Charleston, SC
Re: jm to shp Collision File Maker
i really wish someone would make a video to explain all of this. i dont even know how to save as .jm.