reflection matrix
Does anyone know how to define a 4x4 matrix to reflect 3d stuff accross a plane?
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.
If you really want the matrix and not something much simpler described to me here, I can send you scans of my paper on which I developed the said matrices (I''m not going to type them off)
I may be getting older, but I refuse to grow up
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.
John BlackburneProgrammer, The Pitbull Syndicate
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement