Jump to content
  • Advertisement
Sign in to follow this  
Tiga

How to calculate a symmetrical vector

This topic is 4787 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

Hi Im doing this project now and I ran into some problem with the maths. What I have is two vertices in 3D. Given a normal of one of the vertices how do I calculate a normal that is symmetrical to it with respect to the vector between the two vertices? What I would like is for the normals to align themselves like so: \_________/ <-normals, i got the first one, how to calculate the second? o-------->o <-vertices and vector between them or like so: |_________| o-------->o or like so: -o------->o- I hope I make sense :-) Thanks for any help Radek

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure I understand the question. Could the second normal be nothing more than a reflection across an axis? Sorry I can't help more.

\ / Reflection across "y" axis (2D)
Normal 1 = < x, y >
Normal 2 = < -x, y >

Share this post


Link to post
Share on other sites
I think it would be like the reflection of the normal across the plane of which the line between the vertices is the normal. And the plane is halfway between the two vertices. I hope that's clear - I'm going to bed now! Nearly midnight!

Share this post


Link to post
Share on other sites
I think this is similar to DrGUI's answer, but anyway, given two points p0 and p1, and a normal n0, you should be able to get n1 as you describe like this:

Vector3 n = Normalize(p0-p1);
n1 = n0-2*n0.Dot(n)*n;

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!