jm to shp Collision File Maker

All about making tracks for MX Simulator
ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

jm to shp Collision File Maker

Post 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.
Attachments
shp file generator.rar
(4.95 KiB) Downloaded 350 times
stevoktm
Posts: 1067
Joined: Fri Dec 11, 2009 5:08 pm
Location: England

Re: jm to shp Collision File Maker

Post by stevoktm »

Thanks for this I can make my own fmx objects now.
Image
yzmxer608
Posts: 15352
Joined: Mon Dec 29, 2008 4:30 am
Team: SYS
Location: Wisconsin, U.S.A

Re: jm to shp Collision File Maker

Post by yzmxer608 »

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.
jlv
Site Admin
Posts: 14913
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: jm to shp Collision File Maker

Post 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.
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.
mace-x
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

Post by mace-x »

fuck yeah!
thanks a lot david! :D
i´ll test it as soon as i have time! :twisted:
Image
Massacre ftw!

the human stupidity and the universe are unlimited, and im not totally sure about the universe...
ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: jm to shp Collision File Maker

Post 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
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: jm to shp Collision File Maker

Post 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
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: jm to shp Collision File Maker

Post by DJ99X »

Answered my own question: Displacement map
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: jm to shp Collision File Maker

Post by DJ99X »

Spheres are no good for riding on. But this thing is certainly good for making your basic contact collisions.

ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: jm to shp Collision File Maker

Post by ddmx »

In the case of a rock, adds to the element I guess haha. Not too many smooth boulders out there.
Kamloops
Posts: 299
Joined: Mon Jun 13, 2011 3:26 pm
Location: France

Re: jm to shp Collision File Maker

Post by Kamloops »

Hey,

Someone can re-upload the program ? Cuz i need it, but the link on the first post don't work..
Kamloops
Posts: 299
Joined: Mon Jun 13, 2011 3:26 pm
Location: France

Re: jm to shp Collision File Maker

Post by Kamloops »

Up ! Please :(
I need it now... :/
stevoktm
Posts: 1067
Joined: Fri Dec 11, 2009 5:08 pm
Location: England

Re: jm to shp Collision File Maker

Post by stevoktm »

Image
Kamloops
Posts: 299
Joined: Mon Jun 13, 2011 3:26 pm
Location: France

Re: jm to shp Collision File Maker

Post by Kamloops »

Thanks man ! :D
barrington314
Posts: 6614
Joined: Fri Feb 18, 2011 6:03 pm
Team: me
Location: Charleston, SC

Re: jm to shp Collision File Maker

Post by barrington314 »

i really wish someone would make a video to explain all of this. i dont even know how to save as .jm.
Post Reply