Jump to content
  • Advertisement
jscalo

Finding 3D position between two 3D nodes

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

This is a pretty basic math question but I'm having trouble with it. Say I have two 3D nodes, n1 and n2, represented by 3D position vectors. How can I find a new position n3 that's between n1 and n2, specified as some distance m from n1?

In 2D space I think this would be

Θ = tan(n2.y - n1.y / n2.x - n1.x)
n3 = [m cos Θ, m sin Θ]

In 3D space I believe we need two of the euler angles but I'm not sure which ones or what to do with them.

(If it makes a difference I'm working with iOS SceneKit.)

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

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