Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How can I reflect a point with respect to a plane?

Example:

I have three points (0,0,2), (4,0,0) and (0,8,0). And I have a point (x,y,z). From these, I want derive a composite transformation matrix. How can I do that?

share|improve this question
2  
What have you tried? What problems did you run into? And lastly: smells like homework, is it? –  Eric Nov 12 '12 at 14:30
    
@Eric I donot know how to solve it ? –  gveaf Nov 12 '12 at 14:44
1  
@user1796528 welcome. On this site, those kind of questions normally require you to have already some work done. This is because this is not a place to just wait for someone answer any and all of your questions. You have to show work –  J. C. Leitão Nov 12 '12 at 17:02
    
From the way your question is worded, it sounds like your first three points identify your plane and the fourth is the one you want to reflect about that plane. Is that correct? –  Josh Petrie Nov 12 '12 at 18:16

2 Answers 2

Three points, A, B and C define a plane. The lines AB and AC are both on the plane, so their normalised cross product, perpendicular to both lines, is the plane's normal n:

n = normalise( (B - A) ⨯ (C - A) )

The equation for the plane is given by: n · x + d = 0, where -d is the displacement between the plane and the origin in the normal direction, i.e.: d = -n · A.

An arbitrary point x can be described as the sum of two vectors, u pointing from plane to point in the normal direction, v being the other component:

u = (x · n + d) n

v = x - u

The mirror image of x can then be calculated by flipping the u-component: x' = -u + v. Now that x' is known, capturing the calculation in a transformation matrix is trivial: solve T x = x' for T.

share|improve this answer
    
The question asks for a matrix solution. Your explanation is solid, just not quite what the asker is looking for. :) –  Sean Middleditch Nov 13 '12 at 9:32
    
Good note. The transformation matrix is easily found from here, but that's rather moot if you have calculated x' already. There are of course shortcuts and simplifications you could apply, but in my opinion, going into detail there calls for proper mathematical formatting. –  Marcks Thomas Nov 13 '12 at 11:47

Given the following:

The calculation steps for the augmented reflection matrix are as follows:

1) Calculate the 3x3 reflection matrix R0 for a plane with the same normal vector, but which lies at the origin

Ro = I - 2 NNT

2) Augment the reflection matrix to create the augmented reflection matrix RA

3) Calculate the final augmented reflection matrix by first applying the translation A, mirroring the point by RA, then applying the reverse of the translation A-1

R = ARAA-1

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.