Jump to content
  • Advertisement
Sign in to follow this  
Rosencrantz

Find a third point, knowing two position vectors

This topic is 555 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 guys,

 

my vector math is a bit limited and rusty, and I encountered this problem I need to solve.

 

2GaNJBA.png

 

I have two different objects in the game world, their positions being V1 and V2. I need to find the position V3, knowing only V1V2 and of course their distance.

The solution should work for arbitrarily oriented objects (in the picture, example A is axis-aligned, while B and C are not).

V1 and V2 will always be parallel, but they could have inverse directions (example C in the picture above).


Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement

Yes, it's the (normalized) forward direction of the object in V2.

If I project point V1 on the "forward" of V2, what do I get? Red or Blue in the following picture?

bqhANEE.png

Share this post


Link to post
Share on other sites

You get red. Remember that the direction of V2 is expressed as a relative value. As such, that direction represents an infinite line that passes through V2 and the arrow you've drawn (and the dotted line in your previous examples), and it's that which is projected onto. The position of V2 is not a value that even enters into the equation.

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!