Page 1 of 3

jm to shp Collision File Maker

Posted: Fri Dec 24, 2010 7:35 pm
by ddmx
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.
Image

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.

Image

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.
Image

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.

Re: jm to shp Collision File Maker

Posted: Fri Dec 24, 2010 8:37 pm
by stevoktm
Thanks for this I can make my own fmx objects now.

Re: jm to shp Collision File Maker

Posted: Fri Dec 24, 2010 8:49 pm
by yzmxer608
Sweeeeeet! I'll have to try it later on something to see how it is. Thanks man!

Re: jm to shp Collision File Maker

Posted: Fri Dec 24, 2010 10:34 pm
by jlv
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.

Re: jm to shp Collision File Maker

Posted: Sat Dec 25, 2010 4:12 am
by mace-x
fuck yeah!
thanks a lot david! :D
i´ll test it as soon as i have time! :twisted:

Re: jm to shp Collision File Maker

Posted: Sat Dec 25, 2010 5:54 am
by ddmx
mace-x wrote:fuck yeah!
thanks a lot david! :D
i´ll test it as soon as i have time! :twisted:
haha, Merry Christmas from me and servatis :D

Re: jm to shp Collision File Maker

Posted: Mon Jan 03, 2011 12:26 am
by DJ99X
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

Image

Re: jm to shp Collision File Maker

Posted: Mon Jan 03, 2011 12:33 am
by DJ99X
Answered my own question: Displacement map

Re: jm to shp Collision File Maker

Posted: Mon Jan 03, 2011 12:57 am
by DJ99X
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

Posted: Mon Jan 03, 2011 2:08 am
by ddmx
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

Posted: Wed May 02, 2012 8:27 am
by Kamloops
Hey,

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

Posted: Wed May 02, 2012 2:21 pm
by Kamloops
Up ! Please :(
I need it now... :/

Re: jm to shp Collision File Maker

Posted: Wed May 02, 2012 5:24 pm
by stevoktm

Re: jm to shp Collision File Maker

Posted: Wed May 02, 2012 5:35 pm
by Kamloops
Thanks man ! :D

Re: jm to shp Collision File Maker

Posted: Wed May 02, 2012 7:30 pm
by barrington314
i really wish someone would make a video to explain all of this. i dont even know how to save as .jm.