Physics Box Model in Milkshape3D

From Valve Developer Community
Jump to: navigation, search
English (en)Русский (ru)Translate (Translate)
Info content.png
This page may have misleading content. Please help clarify the content.
For help, see the VDC Editing Help. Also, remember to check for any notes left by the tagger at this article's talk page.
Info content.png
This page is Machine translated
It is not recommended to use machine translation without any corrections.
If the article is not corrected in the long term, it will be removed.
The final version of PhysBox

There are times when you may not have 3DS Max or Maya at hand, but only some simple 3D editor. Of course, it is not necessary to create it in the editor, you can simply take the original model as a basis, but the physical model may not turn out to be correct.

This tutorial describes in detail the creation of a physical box in the MilkShape 3D program. In fact, using this principle you can create it in absolutely any editor.

Note.pngNote:This tutorial is designed for beginners in 3D modeling. The entire article is extremely detailed.

What is PhysBox?

What is physBox? This is a simplified, rough, 3D model that the engine perceives as a physical shell of the original model. It says why the engine cannot perceive the original model as a physical shell.

Main article:  Physics_and_Ragdolls

Requirements

  • MilkShape 3D.
  • Initial model.
  • Minimal knowledge of model compilation.

Creation of PhysBox

First of all, we launch the program, and load our model into the menu in .smd format: File -> Import -> Half-Life SMD...

In this case, the SMD Import window will pop up. These are the loading parameters for our model. It is important that all three boxes are checked, if one is not checked, then check it and click OK.

Or if we have a model in .ms3d format, then: File -> Open and select the model.

After loading our model, on the right side, in the Model tab, select Box. This is the option for creating a simple box. Next, approximately according to the model, we build the first box.

Select the Select' tool and adjust our vertices approximately according to the model. (It is important that the Ignore Backfaces checkbox is unchecked, because with this parameter the opposite point will not be selected). Moving points, etc. carried out using the Move tool.

As soon as we adjust our first box, go to the Groups tab and there we double-click on Box01 < No Material > and then our box will be highlighted. Next, go back to the Model tab and select the Move tool. Now press on your keyboard Ctrl + D' this keyboard shortcut executes the command Edit -> Duplicate Selection i.e. copies what we selected. After pressing these keys, move the duplicated box to the side. And adjust the tops again.

Creation of PhysBox

So you should cover your entire model as you require. At the same time, it is better to make sure that the original model does not come out of our future Fizbox. Those. we need to adjust them so that they are right next to our original model. You should get something like this:

Creation of PhysBox

This concludes our physical boxing. It remains to configure our model.

PhysBox settings

In order for the compiler to make our model correctly, we need to set special parameters for our model.

The first thing we need to do is delete our original model. But, You must know which bone it is attached to. To do this, go to the Joints tab and select some bone, then click on SetAssigned (Action 2 in the photo) i.e. select those vertices that belong to this bone. Thus, find the bone to which the original model is attached. Remember the name of this bone, and press the Delete key on your keyboard. Thus we delete the original model.

SetAssigns Vertex ms3d.PNG

Next, select all the created groups of boxes. You can do this in the Groups tab, selecting all the objects we created. Or simply using the Select tool as shown in the picture below:

Highlighting our physical boxes

The next step is to attach the texture. The compiler will not compile a model without a texture.

And so, go to the Materials tab, select the texture and press the Assign button (Action 3 in the photo) i.e. Apply our texture to the selected group.

Texturing box ms3d.PNG

Or if you don’t have a texture, then do action 1 (image) i.e. create a new texture and then action 2 (image) i.e. choose a texture.

For PhysBox to work correctly, the compiler needs our boxes to have smoothing group 1. He simply ignores other groups. Let's see what we have to do with smoothing group 1. Follow steps 1 and 2 with photo:

Wrong group smooth.PNG

Number 3 shows that we belong to smoothing group 1. This is not correct... The entire model should have stood out. So, let's fix this. Perform actions on the photo.

Fix Group Smooth.PNG

  • Action 1 - Clear all smoothing groups. They converge on the first group.
  • Action 2 and 3 - Check the first smoothing group.
  • Action 4 - The entire model is selected. It's right!

The last step is to attach the model to the bone. Go to the Joints tab and select the bone to which the original model was attached. (Don't forget that you must have all our boxes selected) Follow steps 1 and 2 with the photo:

SetAssigns Vertex ms3d.PNG

Instead of all the groups of our boxes, their tops should stand out. Is everything right? That's good.

Next, we export our model to .smd. Namely: File -> Export -> Half-Life SMD

In the window that pops up, select the save folder with our .qc file, and enter the name, for example: physical_model and click Save

Another window will pop up: SMD Export export parameters. Select Reference i.e. shell and not animation and click OK.

Compiling a model with PhysBox

The last step to creating a PhysBox is to compile the original model along with it. Why second to last? Well, suddenly your physical box turns out to be “clumsy”, then you will have to fix it. But more on that later.

So, open your .qc file and add the following lines at the very end:

$collisionmodel "w_kukuri_phy.smd" // Choosing a PhysBox model

{
    $concave // An important parameter that allows the compiler to make the physical box not solid, but rather convex
    $mass 1.4 // The mass of our object
}

Find more about QC teams.

That's it, now we compile the model, launch the Model Viewer and see what we got, after checking the box, action 1 in the photo.

Final PyshBox MS3d.png

Fizbox model fix

Sometimes it turns out that the physics box you created looks like this:

Wrong PhysBox.PNG

Take a closer look, it has gaps, it turned out to be splashed somehow. This is due to the fact that our boxes are either placed incorrectly or have too small a width. We fix this by:

  • Changing the width. (Action 1 in the photo)
  • Moving the tops of the boxes. (Action 2 in the photo)

Fix Phys-Boxs.PNG

Ultimately, you will get the right physical boxing.

Good luck with your modeling!!!

Author: --Slam12f 23:13, 17 May 2013 (PDT)