Does anyone know how to define a 4x4 matrix to reflect 3d stuff accross a plane?

# reflection matrix

Started by llvllatrix, Jul 19 2002 10:54 AM

3 replies to this topic

Sponsor:

###
#2
Senior Moderators - Reputation: **1787**

Posted 19 July 2002 - 10:57 AM

Multiply matrices A * B * C * D * E, where each does the following:

A: translate the plane to the origin.

B: rotate the plane to the XY plane.

C: invert the Z coordinate.

D: inverse of matrix B

E: inverse of matrix A

Don''t listen to me. I''ve had too much coffee.

A: translate the plane to the origin.

B: rotate the plane to the XY plane.

C: invert the Z coordinate.

D: inverse of matrix B

E: inverse of matrix A

Don''t listen to me. I''ve had too much coffee.

###
#4
Members - Reputation: **351**

Posted 22 July 2002 - 01:43 AM

If the plane is through the origin the reflection if given by

x'' = x - 2(x.n)n

where n is the unit normal to the plane. This is a linear function of x, so it has a matrix representation,

x'' = Mx

where M is the matrix

( 1 - 2aa, -2ab, -2ac)

( -2ab, 1 - 2bb, -2bc)

( -2ac, -2bc, 1 - 2cc)

where (a, b, c) is the unit vector n, aa = a * a, i.e. ''a'' squared.

This is a 3x3 matrix reflecting in a plane through the origin. Note it is NOT a rotation matrix, so do not try to check it as such. E.g. it''s determinant is not 1 but -1.

If the plane is not through the origin it requires a 4x4 matrix with a translation element. The translation part equals what happens to the origin when reflected, and the origin is reflected though a distance twice it''s distance from the plane along the direction of the plane normal, i.e. just work out the position of the origin after the reflection to complete the matrix.

x'' = x - 2(x.n)n

where n is the unit normal to the plane. This is a linear function of x, so it has a matrix representation,

x'' = Mx

where M is the matrix

( 1 - 2aa, -2ab, -2ac)

( -2ab, 1 - 2bb, -2bc)

( -2ac, -2bc, 1 - 2cc)

where (a, b, c) is the unit vector n, aa = a * a, i.e. ''a'' squared.

This is a 3x3 matrix reflecting in a plane through the origin. Note it is NOT a rotation matrix, so do not try to check it as such. E.g. it''s determinant is not 1 but -1.

If the plane is not through the origin it requires a 4x4 matrix with a translation element. The translation part equals what happens to the origin when reflected, and the origin is reflected though a distance twice it''s distance from the plane along the direction of the plane normal, i.e. just work out the position of the origin after the reflection to complete the matrix.