Model Editor: Transformations

Issue #79 resolved
Carsten Fuchs
created an issue

- In `CafuModelT`, the joints hierarchy for the bind pose has ''absolute'' transforms, but the joints hierarchy for the anims has ''relative'' transforms -- both should be ''relative'' though: - eliminates inconsistency, - proper submodel rendering also in bind pose (no animations required in submodel), - transformations of the whole model (at the root joint) become much simpler and more reliable.

- All transformations (especially at the root joint, but elsewhere as well) should ask the user whether they should apply to the bind pose and all animations, or only a subset thereof (`wxGetSelectedChoices()`).

- A customizable, spatial grid like in the Map Editor should be provided.

- It's not 100% clear what our models default orientation is. Right now, "ahead/forward" is along the x-axis, which seems to be in accordance with many games (e.g. HL1 through Q4), but there are reports that HL2 uses "ahead/forward" along the y-axis, which I'd much prefer, as it's much more natural (TODO: check HL2 SKD?).

- Finally, it's not entirely clear to me what rules we should impose on the origin and bounding-boxes of models, if any. For example, should the origin be at the "bottom" of the model, so that placing it on ground is easier, or can it live at an arbitrary point that the artists choses, e.g. the center of the model?

Comments (6)

  1. Carsten Fuchs reporter

    (In [352]) Changed the `CafuModelT` implementation to store the joints for the bind pose as local transformations relative to their parent bone, and updated the model loaders accordingly.

    This change implements the first item of ticket #79. It: - removes inconsistency (the joints hierarchies for animations use local transformations as well (they always did)), - allows using models as submodels even if they have no animation, - makes editing the bind pose in the Model Editor's "Joint Inspector" feasible and comprehensible.

    References #79.

  2. Carsten Fuchs reporter

    (In [354]) Added a new dialog for transforming the entire model (in the selected animation sequences or the bind pose). The dialog is still a stub only, its functionality remains to be implemented.

    References #79.

  3. Carsten Fuchs reporter

    (In [358]) Completed the dialog for transforming the entire model (in the selected animation sequences or the bind pose).

    This change implements the second item of ticket #79, although a bit different (better!) than originally described: - The joints of the bind pose can be individually transformed in the Joint Inspector, by setting "absolute" transformation values that are relative/local to the parent joint. (That is, "relative" transformations like "move +10 units along the x-axis" or "rotate -90° around the z-axis" are in the Joint Inspector not possible at this time, but we may implement this at a later time.) - The newly completed dialog implements relative transformations of the entire model (i.e., the root joint), either for the selected animation sequence(s), or the bind pose (if no animation sequence is selected).

    Note that transforming individual (non-root-)joints of animation sequences is not useful: absolute transformations would destroy the animation; relative transformation are better but their results are hard to foresee and really should be done in a dedicated model animation software instead.

    References #79.

  4. Carsten Fuchs reporter

    An update about item 4 (model orientation) and item 5 (model origin) of this ticket:

    '''Ad item 4 (model orientation)'''

    For models (but strongly opposed to world coordinates), "ahead/forward/north is along the x-axis" seems to be the universal standard, also with HL2, see

    However, I don't think that we need to find and fix any "new" rules for this now. There are rules for "view (weapon) models" already, and if ever anything else is required later, it can still be added.

    '''Ad item 5 (model origin)'''

    No new rules required here as well, let's keep things as simple as possible. Each model has an origin, and each model has a bounding-box (or several, one per animation sequence), each bounding-box has a center.

    For example, consider a breakable crate that is made of individual gibs. Each gib is an individual model, but all models have the same origin (that of the crate), so that the individual gibs can be properly placed relative to the crate. The bounding-box and the center of the bounding-box of the gib will however be used for lighting, physics, etc.

    Note that it should be possible in the Map Editor to move and align the model both by the edges of it's bounding box, by the bounding-box center, as well as by its origin.

  5. Log in to comment