-
Angle between two points
Hi there.
Can you help me?
I got two points(X,Y,Z) A and B in space.
How can I find the look vector from A to B grom a given moment?
I mean, at zero frame, "A" got no rotation at all.
And at frame 10, for example, "B" move 10 units on -X. How can I calculate the angle I have to rotate in "A" to continue viewing the "B" coordinate ?
-
Junior Member
Regular Contributor
Re: Angle between two points
Dear Guilhereme,
1. lookAtVector = pointB - pointA
2. I am not sure But try this
a. value = ((pointB.x - 10)/lookAtVector.z)
b. angle = arctan(value);
Rajesh.R
IRIS,CAIR,
Bangalore - 1
-
Senior Member
OpenGL Guru
Re: Angle between two points
search for 'The Matrix and Quaternions FAQ'
Q39. How do I generate a rotation matrix to map one vector onto another?
although How can I find the look vector from A to B grom a given moment?
is simple A-B perhaps normalize the result
-
Re: Angle between two points
The vector from A to B is B-A. It's always target minus source
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules