Resizing Models

From The DarkMod Wiki
Revision as of 18:05, 5 November 2009 by Fidcal (talk | contribs) (New page: ''written by Fidcal'' Resizing models is generally not recommended but I do it a lot. It works fine with many models but there are a few fixes needed. * This method does not work with a...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

written by Fidcal

Resizing models is generally not recommended but I do it a lot. It works fine with many models but there are a few fixes needed.

  • This method does not work with any AI or corpses.
  • It does not work with moveables or movers. (I am unsure about movers - it might be OK if they are symmetrically resized, eg, all dimensions doubled.)
  • It does not work with all static models anyway. So you have to try it on a particular model then check it in-game to see if it looks and works correctly. It's a hack. This is how I do it:

Do not rotate the model first. If you have then first delete the rotation property. Otherwise the numbers might be too complex to deal with easily (try it and see!)

Give the model this property:

rotation 1 0 0 0 1 0 0 0 1

That mean unrotated scale normal. (a quick way to get the above from UNrotated is rotate 45 degrees then back again in top view.)

The 1's are the scale so double all sides would be 2 0 0 0 2 0 0 0 2 Or half width double height might be 0.5 0 0 0 0.5 0 0 0 2 Note that these are world oriented so if you need to rotate the model later you should anticipate that and change the side that will be turned that way after you rotate it! (experiement and undo and you'll see soon see what I mean. If you make a long table even longer then rotate it then now it is not longer but 'fatter'!)

Once you've done the above then you can rotate the model if necessary subject to what I said above.

The collision model is now 'wrong' (it's still the original size) so give the model the property solid 0. Now you and AI can walk through it so build a nodraw solid brush(es) inside roughly the shape (there are nodraw solid textures for different materials so pick the right one eg, nodraw_solid_wood so it sounds correct when impacted.)

The shadow will be 'wrong' (it's still the original size). Set the model noshadows 1 so it has no shadow. If you want a shadow then make the inner brush to be a real material like wood.

If there is a texture specular map (shinyness) then it won't scale so the texture might go unnaturally dark, almost black. Avoid those. But many models work fine.