Model Scaling

From The DarkMod Wiki
Jump to navigationJump to search

Rescaling Models with Dark Radiant's "Model Scaler"

By Geep, 2019

Basic Operation - Symmetric Scaling

The "Model Scaler" button, on the left side of the DR screen, is the best way to resize a model. As its name implies, it works with models, not entities, brushes, patches, or AI.

After creating or selecting a model instance in the grid, pressing Model Scaler encloses it in a rectangular box. Drag any of the box corner "handles" (blue dots) with a mouse to enlarge or shrink it symmetrically. The chosen-handle movement may not stay aligned perfectly with the mouse cursor movement, so you may need to interrupt the drag and reposition. To elaborate, the box handles are constrained to the grid, so, when the grid setting isn't fine-grained, the corners will seem to jump. In that case, a series of short mouse drags will maintain better control than one long fast drag.

Scaling by a Fixed Amount

Usually the scaling is simply done by eye. But if it is important to scale up or down by an (approximately) fixed factor:

  • Select a relatively fine grid size, so Model Scaler's handles move more fluidly.
  • Before scaling, note the size of some dimension (e.g., x width) in a DR orthogonal view
  • Calculate what that "target dimension" should be once the factor is applied.
  • As you resize with Model Scaler, keep an eye on the target dimension.

How the Model Scaler Works

Using the Model Scaler clones the original distributed model, resizes it by changing all the edge lengths, and saves the result as a new file in the models/map_specific folder/scaled/ folder of your FM. So if you create a grammaphone instance by picking… darkmod/musical/grammo3.ase …and use Model Scaler, the result in the Entity Viewer for "model" might be: models/map_specific/scaled/grammo3_scaled1.ase If you create multiple objects with different scale factors, multiple files are created, with trailing number bumped.

Alternative Techniques

Using Model Scaler to Resize in One Dimension Only

Addition by grayman, 2019

Do the following:

  1. Select the model.
  2. In the Entity viewer, delete any "rotation" spawnarg on the model.
  3. Click the Model Scaler button.
  4. Click and hold on the box corner that you're going to move.
  5. Hold down the shift key.
  6. Drag the cursor in the desired direction. If you drag in the x direction, for example, both the y and z model dimensions will remain the same.
  7. Leave the Model Scaler.
  8. Save the map. This sets the new scaled model as the one to be used.
  9. Rotate the new scaled model back to where it originally was before you deleted the "rotation" spawnarg.

Outside Dark Radiant

The most obvious alternative is to do model scaling outside of DR, e.g., in Blender. The appeal of this roundtripping may vary.

Matrix Editing in DR

Generally, with a model, if you try the DR’s top menu “Modify/Rotate and scale…”, the Scale controls are grayed out. This is to discourage you from making scaling changes to the transformation matrix. The TDM/idTech4 engine has significant runtime shortcomings in using the transformation (aka "rotation") matrix for scaling. This includes problems with lighting, rendering, and collisions. If you really need to use this older technique by hand-editing the matrix, see Rescaling,_Resizing,_Models_in_Dark_Radiant and Resizing_Models. A remaining use cases for this older problematic technique might be: you can’t use Model Scaler because there's no model available, only, say, an Entity (e.g., turnip stub).