Jump to content
  • Advertisement
Sign in to follow this  
griminventions

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

Advertisement
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


Link to 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


Link to post
Share on other sites
Quote:
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.


I did.

Quote:
Original post by oliii
V -= (2.0f * (V . N)) * N

is that simple enough?


Apparently not. [depressed]

Share this post


Link to 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


Link to post
Share on other sites
Quote:

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?
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


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

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!