#### Archived

This topic is now archived and is closed to further replies.

# Vector Reflection

This topic is 6317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Heres a question you bright sparks should be able to answer ; I have a vector and I would like to reflect it off a plane. I have the normal of the surface already and the camera vector. How would I calculate the reflection vector? I have this formula; R = I - 2(N NT)I R = Reflected vector I = Incidence vector N = Normal vector NT = Transposed Normal (Pseudo)source code would be helpful, prizes will be issued ... Many thanks obLaho

##### Share on other sites
vReflection = vIncident - 2 * (vNormal * vNormal.transpose() ) * vIncident
?

Magmai Kai Holmlor
- The disgruntled & disillusioned

##### Share on other sites
Very cute.

As I understand it, you cannot transpose a vector, but you can convert the vector to a 3x1 or a 1x3 matrix and transpose it that way. Am I correct?

Bah!

##### Share on other sites
One way is using Geometric Algebra: if m is an initial and n a unit normal to a plane then the reflected vector is

-nmn

The products nm and (nm)n are both the standard product from geometric algebra, and this application of it is covered by any course or book on the subject. This is far more useful than other techniques as apart from being very simple it works in any dimension, not just in 3D.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5
frob
13

• 9
• 15
• 10
• 9
• 17
• ### Forum Statistics

• Total Topics
632602
• Total Posts
3007364

×