Sign in to follow this  

Direction between two vectors on a surface

This topic is 3777 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 there. I am currently using graph theory to detect contours in a mesh. It can be done through the intersection lists from the indexed face sets, but I want to set it up so that I can use a heading vector to pick the correct route faster. If you look at the mesh diagram, and look at the bottom red vertex, you can see that it is surrounded by 6 choices for the next move. What I want to do is compare this with the y axis so I can go 'up' in the mesh. The red vertex is the vertex that protudes most in the x axis, and is the tip of the nose of a laser scanned face. So what I want to do now is go up from the vertex, I need to prune the other 5 choices using their angles from the y axis. I know this has something to do with the cross product, but my maths in 3d vectors is rusty, and I was wondering how i use the cross product to compare the two vectors to the y axis, and pick the one that is closest. http://img518.imageshack.us/img518/2643/nodegraphcj0.jpg Cheers! Craig.

Share this post


Link to post
Share on other sites
You want to find the vector which has the greatest component in the direction of the y-axis amongst the set of vectors starting from bottom red vertex and ending on each of the six neighboring vectors? If this is the case, should it not be enough to compare the dot product of each of these vectors with the y-axis and pick the one with the greatest correlation?

Share this post


Link to post
Share on other sites
You want to find the vector which has the greatest component in the direction of the y-axis amongst the set of vectors starting from bottom red vertex and ending on each of the six neighboring vectors? If this is the case, should it not be enough to compare the dot product of each of these vectors with the y-axis and pick the one with the greatest correlation?

That sounds about right!

The surface thing is confusing me. I've done this between two vectors in space, but never on a surface. Basically, i need to travel 'up' on the mesh as much in the y-axis as possible.

I've done this in 2d for a map based routing system.
Get the heading vector by (End - CurrentLocation) then whenever you read a junction, use the angle between the possible route and the heading vector to decide which branch to take, this ensures you are going in approximately the right destination, but i've not done it in 3d before.

Share this post


Link to post
Share on other sites
I feel I must be missing something. Each move is from one vertex to another, correct? You don't ever stop inbetween vectors? And all the vectors from a vertex to any neighboring vertex will lie on the surface, correct? And the only interesting factor for selection of a vector is the component in the y-axis? Is it not enough to select the vector with the greatest projection on the y-axis?
Calculate:

vky
rk = --------
||vk||

for all vectors vk, k∈N, where y is the normalized y-axis. The vector which produces the greatest r should be the direction you are looking for.

Share this post


Link to post
Share on other sites

This topic is 3777 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.

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