gteMIMefunc

Adds a vertex data vector to a differential data vector multiplied by a control coefficient

void gteMIMefunc (
        SVECTOR *otp,
        SVECTOR *dfp,
        long n,
        long p
)

Arguments

otp Pointer to vertex data vector (input/output)
dfp Pointer to differential data vector (input)
n Number of vertices (differentials)
p MIMe weight (control) coefficient

Return Value

None.

Explanation

The vertex data vector otp is added to the product of the differential data vector dfp and the MIMe control coefficient p, and the result is stored back in the vertex data vector otp.
p is considered to be a 12-bit integer.
This following program fragment illustrates the algorithm that is used:

void gteMIMefunc(SVECTOR *otp, SVECTOR *dfp, long n, long p)
{
    int i;
    for( i = 0; i < n; i++) {
      (otp+i)->x += ( (int)((dfp+i)->x) * p )>>12;
      (otp+i)->y += ( (int)((dfp+i)->y) * p )>>12;
      (otp+i)->z += ( (int)((dfp+i)->z) * p )>>12;
    }
}

The argument format is as follows:
    p: (1,19,12)
    otp, dfp optional

See Also

SVECTOR