Model Scaling: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
Geep (talk | contribs)
Reformat and editing
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Page Title: Rescaling Models with Dark Radiant's “Model Scaler”
= Rescaling Models with Dark Radiant's "Model Scaler" =
''By Geep, 2019''


[This page is a draft. Please help make it better. Geep]
== 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.


== Basic Operation ==
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 ==
The "Model Scaler" button, on the left side of the DR screen, is the best way to resize a model symmetrically. 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 vertices (blue dots) with a mouse to enlarge or shrink it. The vertex movement may not stay aligned perfectly with the mouse cursor movement, so you may need to interrupt the drag and reposition.
 
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:
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 handles move more fluidly.
* 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
* 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.
* 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.
* As you resize with Model Scaler, keep an eye on the target dimension.
 


== How the Model Scaler Works ==
== 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…
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
darkmod/musical/grammo3.ase
…and use Model Scaler, the result in the Entity Viewer for “model” might be:
…and use Model Scaler, the result in the Entity Viewer for "model" might be:
models/map_specific/scaled/grammo3_scaled1.ase
models/map_specific/scaled/grammo3_scaled1.ase
If you create multiple objects with different scale factors, multiple files are created, with trailing number bumped.
If you create multiple objects with different scale factors, multiple files are created, with trailing number bumped.


== Alternative Techniques ==


== Alternative Techniques ==
=== Using Model Scaler to Resize in One Dimension Only ===


''Addition by grayman, 2019''


Do the following:


== Outside Dark Radiant ==
# Select the model.
# In the Entity viewer, delete any "rotation" spawnarg on the model.
# Click the Model Scaler button.
# Click and hold on the box corner that you're going to move.
# Hold down the shift key.
# 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.
# Leave the Model Scaler.
# Save the map. This sets the new scaled model as the one to be used.
# 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.
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 ===


== Matrix Editing ==
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).
 
 
As for DR-only methods, 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/Doom 3 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].
 
Remaining use cases for this older problematic technique might be:
• For non-symmetric scaling (in which case you use different factors for X, Y, and Z matrix entries).
• When you can’t use Modify Scaler because, say, you don’t have a model available, only an Entity (e.g., turnip stub).

Latest revision as of 18:11, 24 March 2020

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).