# NNSG3dMatAnmResult

## C Specification

    #include <nnsys/g3d/anm.h>

    typedef enum
    {
    NNS_G3D_MATANM_RESULTFLAG_TEXMTX_SCALEONE   = 0x00000001,
    NNS_G3D_MATANM_RESULTFLAG_TEXMTX_ROTZERO    = 0x00000002,
    NNS_G3D_MATANM_RESULTFLAG_TEXMTX_TRANSZERO  = 0x00000004,

    NNS_G3D_MATANM_RESULTFLAG_TEXMTX_SET        = 0x00000008,
    NNS_G3D_MATANM_RESULTFLAG_TEXMTX_MULT       = 0x00000010,
    NNS_G3D_MATANM_RESULTFLAG_WIREFRAME         = 0x00000020
    }
    NNSG3dMatAnmResultFlag;

    typedef struct NNSG3dMatAnmResult_
    {
    NNSG3dMatAnmResultFlag  flag;
    u32                     prmMatColor0;
    u32                     prmMatColor1;
    u32                     prmPolygonAttr;
    u32                     prmTexImage;
    u32                     prmTexPltt;

    fx32                    scaleS, scaleT;
    fx16                    sinR, cosR;
    fx32                    transS, transT;

    u16                     origWidth, origHeight;
    fx32                    magW, magH;
    }
    NNSG3dMatAnmResult;

## Description

The `NNSG3dMatAnmResult` structure stores material information. GD3 uses the information stored in this structure to send commands to the Geometry Engine. The structure is created and used during the execution of the `NNSi_G3dFuncSbc_MAT` function (i.e., when it is called during the SBC's MAT command process). To implement material animation, the `NNSi_G3dFuncSbc_MAT` function acts internally to set the data stored in this structure in accordance with the animation data. By setting a callback in `NNS_G3D_SBC_MAT`, the material's settings can be controlled from the user program.

Data Member | Description
--- | ---
flag | The flag of type `NNSG3dMatAnmResultFlag`.
prmMatColor0 | Stores diffuse and ambient. Equivalent to the parameter of the `MaterialColor0` geometry command.
prmMatColor1 | Stores specular and emission. Equivalent to the parameter of the `MaterialColor1` geometry command.
prmPolygonAttr | Stores the polygon attribute value. Equivalent to the parameter of the `PolygonAttr` geometry command.
prmTexImage | Stores the texture parameter. Equivalent to the parameter of the `TexImageParam` geometry command.
prmTexPltt | Stores the texture palette's base address. Equivalent to the parameter of the `TexPlttBase` geometry command.
scaleS | The texture's scale value in the `S` direction.
scaleT | The texture's scale value in the `T` direction.
sinR | The sine of the texture's rotation angle.
cosR | The cosine of the texture's rotation angle.
transS | The parallel transform component in the `S` direction for the texture.
transT | The parallel transform component in the `T` direction for the texture.
origWidth | The width of the texture corresponding to the material at time of `g3dcvtr` output.
origHeight | The height of the texture corresponding to the material at time of `g3dcvtr` output.
magW | The magnification determined when binding model and texture. Normally this is FX32_ONE.
magH | The magnification determined when binding model and texture. Normally this is FX32_ONE.

`NNSG3dMatAnmResultFlag` Values | Description
--- | ---
`NNS_G3D_MATANM_RESULTFLAG_TEXMTX_SCALEONE` | When this flag is set, the values stored in `scaleS` and `scaleT` are disabled. Both are treated as if `FX32_ONE` has been entered.
`NNS_G3D_MATANM_RESULTFLAG_TEXMTX_ROTZERO` | When this flag is set, the values stored in `sinR` and `cosR` are disabled. `sinR` is `0`, but `cosR` is treated as if `FX32_ONE` has been entered.
`NNS_G3D_MATANM_RESULTFLAG_TEXMTX_TRANSZERO` | When this flag is set, the values stored in `transS` and `transT` are disabled. Both are treated as if `0` has been entered.
`NNS_G3D_MATANM_RESULTFLAG_TEXMTX_SET` | When this flag is set, the texture matrix corresponding to this structure's setting gets set as the current texture matrix.
`NNS_G3D_MATANM_RESULTFLAG_TEXMTX_MULT` | When this flag is set, the texture matrix corresponding to this structure's setting gets multiplied to the current texture matrix.
`NNS_G3D_MATANM_RESULTFLAG_WIREFRAME` | When this flag is set, the polygons belonging to the material are drawn as wireframes.

## See Also

Kernel, Rendering Engine

## Revision History

10/13/2004 Initial version.