User:DougWood

From Valve Developer Community
Revision as of 17:42, 7 July 2005 by DougWood (talk | contribs)
Jump to navigation Jump to search

Creating a view model for Source using XSI

Camera Setup

Lets start by positioning the camera in XSI to give us a similar view as what we will be seeing in the game. Set a 54 degree F.O.V. perspective camera at origin, using the coordinates shown below, facing along the negative Y axis. The Source engine supports any F.O.V., but if you use 54 (which is close to the human eye) you will be able to model a weapon to correct scale without having it look distorted in the engine. We actually use a dual F.O.V. system with Source. In Half-Life 2 the world is rendered at 75 F.O.V. while our weapons are rendered at 54.

Camera settings.jpg

Positioning

If its not in the scene already, merge/import your weapon mesh. Position your weapon to where it looks best in the camera view. To do this move the weapon mesh and not the camera. I recommend doing this before you finish your model because its good to see where to best spend your polygons. As you can see in the below picture (area marked as A.) the front of the shotgun mesh has some detail near the barrel that is not seen in the camera view. Those polygons would perhaps be best used up near the handle or simply deleted.

Shotgun singlemesh.jpg

Merging texture coordinates

In this example, the shotgun and arms have been modeled and textured separately (You will first need to step into the world of imagination and pretend that my example is textured). View model weapons need to consist of a single mesh, so we need to merge both the shotgun and arm meshes together while keeping the texture coordinates in tact. Do to this, merge the arm mesh into the scene File > Merge, next, under the Model panel select Poly. Mesh > Merge. A dialog box will then pop up (shown below). I usually put the tolerance to 0. The tolerance will weld verts that are close to each other. The higher the tolerance number, the more verts will be welded together. This is handy for when you are stitching two models together, such as modeling one side of an object, duplicating and mirroring it, and then welding it back to the original. For this example however, I don't want the hand verts to be welded to any of the weapon verts. Click the All button to merge all materials and texture coordinates into a new single mesh.

Merge armmesh.jpg

XSI creates an additional mesh after a merge (named Polymesh). Freeze the new mesh before deleting the old meshes.

Singlemesh.jpg

Rigging

Now attach the mesh to your rig