Jump to content
• Advertisement

# Reflection off of arbitrary normal

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

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Is there an equation that will calculate the reflection vector of an arbitrary surface normal? (You know, bouncing collision response.) :)

Advertisement

#### Share this post

##### Share on other sites
Fruny: how funny, i see this question every few weeks and so far nobody, NOBODY
has provided any actual solution for it, go google that yourself, you will see
that not even google is able to answer that question, at least not in a way
that I or general public could understand.

#### Share this post

##### Share on other sites
V -= (2.0f * (V . N)) * N

is that simple enough? See basic optics for explanation, or draw it on paper.

how about

V -= (2.0f * (V . N) / (N . N)) * N

if N isn't normalised.

or

Vn = ((V . N) / (N . N)) * N
Vt = V - Vn
V = Vn * (-CoE) + (1.0f - CoD) * Vt

CoE = coefficient of elasticity
CoD = Drag (or firction) coefficient.

ect...

#### Share this post

##### Share on other sites
Quote:
 Fruny: how funny, i see this question every few weeks and so far nobody, NOBODYhas provided any actual solution for it, go google that yourself, you will seethat not even google is able to answer that question, at least not in a waythat I or general public could understand.

I did.

Quote:
 Original post by oliiiV -= (2.0f * (V . N)) * Nis that simple enough?

Apparently not. [depressed]

#### Share this post

##### Share on other sites
what does "V . N" mean? multiply those? why do you then use asterixes too?

#### Share this post

##### Share on other sites
. <==> vector dot product
* <==> vector-scalar or scalar-scalar multiplication

#### Share this post

##### Share on other sites
Quote:
 Original post by GameCat. <==> vector dot product * <==> vector-scalar or scalar-scalar multiplication

so that makes:

V.x:= -(2.0 * (crossProduct(V, N)) * N.x
V.y:= -(2.0 * (crossProduct(V, N)) * N.y
V.z:= -(2.0 * (crossProduct(V, N)) * N.z

is this correct?

#### Share this post

##### Share on other sites
No, the dot product is not the same as the cross product.

#### Share this post

##### Share on other sites
Quote:
 so that makes: V.x:= -(2.0 * (crossProduct(V, N)) * N.xV.y:= -(2.0 * (crossProduct(V, N)) * N.yV.z:= -(2.0 * (crossProduct(V, N)) * N.z is this correct?
Close, but it's the dot product, not the cross product. (Maybe just a typo...) Also, if := is assignment then you probably need to insert V.x, V.y, and V.z, respectively, before the negative sign and after the = sign in each line, like this:

V.x:=V.x - (2.0 * etc...
V.y:=V.y - etc...
V.z etc...

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632993
• Total Posts
3009761
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!