Sign in to follow this  
Tiga

How to calculate a symmetrical vector

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this