Sign in to follow this  
SwimDoc

Moving two points to keep a line between them

Recommended Posts

Hi there everyone. So I am a little disappointed in myself in having this problem but I have banged my head against it and dont see a real good way to solve it. I have created a control in C# that is just a graphical representation of a curve that can be manipulated. This includes viewing influence points for bezier curves. The user can then move those points to change the curve. My problem comes in that I want the user to be able to move on point and have its coresponding point move the same. Currently I am moving one point by a distance and moving the other point by the same distance. That works fine when the points are the same distance from their point on the curve. However, if one is longer they start becoming slightly off and I need them to keep looking like a straight line until the user breaks them. I have also tried setting up a ratio by using the distance traveled over its original distance but I am getting floating errors that shoot to infinity. Also, because these points can move in both directions SOH CAH TOA is out because I do not have a guarenteed right angle. Any thoughts on this would be great. Thank you in advance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this