MTXPushInvXpose

C Specification

#include <revolution/mtx.h>
MtxPtr MTXPushInvXpose ( MtxStack* sPtr, const Mtx m );

Arguments

sPtr Pointer to a MtxStack structure containing the matrix stack.
m Source matrix for inverse transpose computation and post-concatenation with the stack. m is not altered by this function. m may be either an Mtx or an MtxPtr.

Return Values

Returns the stack pointer to the resultant 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 equal to sPtr->stackBase.

On 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 the order of concatenation is post-order, the same as for MTXPushFwd. Using this function, an inverse-transpose stack can be created in parallel with a forward transformation stack using only a single copy of m.

When the result of MTXPushInvXpose causes a stack overflow, ASSERTMSG is executed.

See Also

ASSERTMSG

Mtx, MtxPtr, MtxStack, MtxStackPtr,

MTXConcat
MTXInverse
MTXPush
MTXPushFwd
MTXPushInv
MTXTranspose

Revision History

03/01/2006 Initial version.