Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Creating Physics Models

From HalfLife 2 Knowledge Base

(Redirected from Creatingphymodels)
Jump to: navigation, search

Creating complex collision models by Cannonfodder

In this tutorial I will show how to create a collision model for an Arch.

When creating a model for HL2, you need three smd's. One for the reference model, one for the animations and one for the collision model. If you use the same smd for both the collision model and the the reference model you will usually end up with smoothing group errors and a single collision model which surrounds the entire model. Most times this is sufficient, but if you need a more complicated collision model then you need to do a bit more work.

Here I am creating an arch model for HL2 that looks like the following:

Image:Cf_arch1.jpg

If I use this for the collision model I will end up with the undesireable result shown below


Image:Cf_arch1phy.jpg


Since I want to be able to walk though the arch this is not going to work. Therefore, I need to create a new model which I can use for the collision smd. I do this by using simple boxes. I create one box and convert it to an editable poly. Now I assign ALL faces of that box to smoothing group 1. This looks as follows:


Image:Cf_arch2.jpg


Now I duplicate the box and assign all faces of the new box to smoothing group 2. My image now looks like this


Image:Cf_arch3.jpg


I continue making boxes, and assign all faces of each box to a new smoothing group. So all faces of box1 are assigned to smoothing group1, all faces of box2 to smoothing group2, etc, etc. When I'm all done it should like like this:


Image:Cf_arch4.jpg

Finally I delete the original model, since this will mess up my collision model just as before, and I export the new model and use it as my collision model in the .qc file. I end up with a collision model like so:

Image:cf_arch2phy.jpg

Tada....


Random person's comment: Don't be disappointed if it won't work. It didn't for me and I was very confused then when I found out that it works when you make the complex collision model using a slightly different way. I'll try to make a tutorial out of the way I used later.

EDIT: Check the "Complex Collision Models", it's using similar way I used.


Important Note from TorQue[MoD]:

The first time I followed this tutorial it didn't work for me either, then I figured out why... you need to make sure each of the collision mesh boxes are all assigned to Material ID 1 as well as giving them all the same name ("arch_col" for example... do not attach the pieces together) and finally you need to apply the same texture that is applied to your arch model to all of the collision boxes (just select all the boxes, open your material editor and press the assign material to selected button). Also, you need to select all of the collision boxes and add a physique modifier to them making sure you assign the modifier with rigid and no blending selected, then assign all of the vertices to the bone's link with a rigid (green +) setting. Then export the entire scene as arch_col.smd and everything should work fine.

Note for XSI users

The physmodel has to have a material assigned to it otherwise it won't export. So if you are wondering why your physmodel isn't working it is probably because it doesn't have a material assigned. As the physbox isn't seen, it doesn't really matter what is assigned, so just use an existing one and you don't need to worry about lining up any UV coordinates or anything like that.

Personal tools