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

Normals and Collision Models in MAYA

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Normals and collision Models in MAYA by Prall

Normals

you can display the surface normal direction for the selected mesh with

display->polygon components->normals

pic06hu.jpg

you just need it to make sure all normals point in the correct direction (outside) because game engines dont render double sided so the opposite side from the normal direction is invisible

you can change normal direction with

edit polygons->normals

by default they are set to face and depending on how you created the polygon pointing in the correct direction..if they point in the wrong direction just use reverse

pic19iv.jpg

soft/hard Edges

in Maya we have no smoothing groups like in 3ds but soft/hard edges whats basically the same

you can think of a smoothing group as a bunch of connected soft edges or hard edges

by default all edges are hard...to soften them just use the select tool (1) in component mode (2) edges (3) to select some edges you want to smooth

then edit polygons->normals->soften/harden(options)

click all soft and apply

pic22lh.jpg

see the difference?

pic34lv.jpg

collision models

to create collision load your original model and put it in a shader set to reference (a)

create a bunch of simple poly objects that represent your original model as good as possible

you need seperate objects to make complex collision models because studiomdl likes to truncate concave edges. in my case it wouldnt work with a single cylinder so i make 3 to get the correct shape. also make sure the collision models and the original model share the same origin (normally 0,0,0) you can move the origin (pivot) if you press ins while in translation mode...use snap to grid to get it exacly to 0,0,0. do that for every part of the collision model or polygons->combine them before (also sets pivot to 0,0,0 ;) )

pic40js.jpg

since collision models need to be in 1 smoothing group (means they cant have hard edges) we just select all collision meshes and do

then edit polygons->normals->soften/harden(options)

pic53uz.jpg

click all soft and apply

pic63yx.jpg

now give them a shader with a file node

delete the original model

save the scene as yourmodel_phy

file->export smd-> export as reference checked

now you can use the created smd as collision model in your .qc file like

$collisionmodel "singletree1_phy.smd" 
{
    // Mass in kilograms
    $Mass 10000
    $concave
}

with physics model checked in hlmv it looks like this for my tree

pic75ss.jpg

thats it

Personal tools