Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Christiaan

Point on a line in 3D space...

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

Hiya, I have a fairly easy math problem I think, but I can''t remember how to solve it I have a line in 3D space defined by two points A & B. I also have a point which lies somewhere on that line and only the z coordinate is known. my question is how do I calculate the x & y coordinate of point C ??? chris

Share this post


Link to post
Share on other sites
Advertisement
Let v = B - A

x = A.x + t*v.x
y = A.y + t*v.y
z = A.z + t*v.z

t = (z - A.z)/v.z

so

x = A.x + v.x*(z - A.z)/v.z
y = A.y + v.y*(z - A.z)/v.z

GA

Share this post


Link to post
Share on other sites

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