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 6684 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!