MTXPushInvXpose

Syntax

#include <revolution/mtx.h>

MtxPtr MTXPushInvXpose ( MtxStack* sPtr, const Mtx m );

Arguments

sPtr Pointer to a MtxStack structure containing the matrix stack.
m The source matrix to be joined from the back of the stack by calculating the transpose inverse matrix. m is not altered by this function. m can be an Mtx or an MtxPtr.

Return Values

Returns a stack pointer to the resulting matrix.

Description

Creates an inverse-transpose composite forward transformation matrix on the stack. The inverse-transpose of m is computed as a temporary local variable. m is not altered by this function.

On an empty stack, the function simply copies the inverse transpose of m to sPtr->stackBase and sets sPtr->stackPtr to sPtr->stackBase.

For an active stack, sPtr->stackPtr is multiplied by the inverse-transpose of m and the result is copied to sPtr->stackPtr + MTX_PTR_OFFSET.

This operation is equivalent to the following:

MTXCopy( m, mTmp );
MTXInverse( mTmp, mTmp );
MTXTranspose( mTMp, mTmp )
MTXConcat( sPtr->stackPtr, mTmp, ( sPtr->stackPtr + MTX_PTR_OFFSET) );

This function is designed to create forward transformation matrices for an object's surface normals. This is why, as for MTXPushFwd, concatenation is post-order. Using this function, an inverse-transpose stack can be created in parallel with a forward transformation stack using only a single copy of m.

If the result of MTXPushInvXpose causes stack overflow, ASSERTMSG is triggered.

See Also

ASSERTMSG, Mtx, MtxPtr, MtxStack, MtxStackPtr, MTXConcat, MTXInverse, MTXPush, MTXPushFwd, MTXPushInv, MTXTranspose

Revision History

2006/03/01 Initial version.


CONFIDENTIAL