E.g. lets assume the example you've given above. Now, a point at the global co-ordinates [0,3,2]T is located 3 length unit in front of the second portal. This is because [0,1,0]T is the normal of the second portal; multiplied with 3 length units in this direction, and added to the location [0,0,2]T of portal 2 yields in just that [0,3,2]T.
Now, that point should be seen throught portal 1. Hence, applying the transformation in total
T1 * R1 * R2-1 * T2-1 * [ 0 3 2 ]T
Doing this stepwise from right to left for clarity means
(1) a := T2-1 * [ 0 3 2 ]T
[ 1 0 0 0 ]-1 [ 0 ] [ 1 0 0 0 ] [ 0 ] [ 0 ]= [ 0 1 0 0 ] * [ 3 ] = [ 0 1 0 0 ] * [ 3 ] = [ 3 ] [ 0 0 1 2 ] [ 2 ] [ 0 0 1 -2 ] [ 2 ] [ 0 ] [ 0 0 0 1 ] [ 1 ] [ 0 0 0 1 ] [ 1 ] [ 1 ]
(2) b := ( R1 * R2-1 ) * a
[ 0 0 1 0 ] [ 0 ] [ 0 ]= [ 1 0 0 0 ] * [ 3 ] = [ 0 ] [ 0 1 0 0 ] [ 0 ] [ 3 ] [ 0 0 0 1 ] [ 1 ] [ 1 ]
Here can already be seen that the point's "in front of" has changed to the global z axis!
(3) T1 * b
[ 1 0 0 0 ] [ 5 ] [ 5 ]= [ 0 1 0 0 ] * [ 0 ] = [ 0 ] [ 0 0 1 0 ] [ 0 ] [ 3 ] [ 0 0 0 1 ] [ 1 ] [ 1 ]
Exactly what I would expect. Althought the point is actually located 3 units in front of portal 2, it appears to be 3 units in front of portal 1!
[Edited by - haegarr on September 30, 2006 7:02:57 AM]