Re: [script] Comparing two transforms

Date : Fri, 12 Jan 2007 17:19:18 -0800
To : XSI(at)Softimage.COM
From : "Ben Barker" <ben.barker(at)gmail.com>
Subject : Re: [script] Comparing two transforms
Just think, in the future we will be able to write transform values
out to frame buffers and compare them in a fragment shader using a GPU
on your video card! It will be 10 times faster! ;)

On 1/12/07, François Painchaud <francois.painchaud(at)sympatico.ca> wrote:
Le 2007-01-12 18:26, Joe Laffey a écrit :
On Fri, 12 Jan 2007, Bernard Lebel wrote:
def compare4( oT1, oT2, oMatrixA, oMatrixB ):
        for i in range(0, 4):
        for j in range(0, 4):
            if abs( oMatrixA.Value(i, j) - oMatrixB.Value(i,j) ) < 0.0001:
                return False
    return True
Now if your are REALLY trying to make things fast, for something so short as
16 elements you could easily unroll the loops into a series of if statements
like in the other functions. This avoids the (very slight) overhead of
setting up the loop, and reading from / writing to the iterator variables...
Excellent suggestion! This way, you can order the "if" statements to first
test the values that will most likely change in your homogeneous matrix: the
3 (or 4) translation values, then the 6 rotation/scaling values, then the
rest.

François



--
Ben Barker
Character TD
CafeFX

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.