this is actually for computer programming.
I'm trying to show a line which plots the course taken by a ship. It's in space so drag etc are not an issue but it can continue to accelerate.
I felt initally the answer was to take the end point and figure out the angle between the current heading and angle to point at the end point and divide that in half to find the mid point of a bezier curve. (in half because it would spend one half of the trip accelerating and one half decelerating to reach the correct heading)
the issue is though that because the ship is also moving forward as it rotates its position changes so it changes final angle.
I feel like a cubic bezier curve might be what I need with its 2 points and that PERHAPS one point is directly in front of its starting heading and the other is i'm not sure.
Alternatly maybe its just a simple squared bezier curve and the mid point is basically where assuming the point you want to end up at is somewhere in front of the ship. Its the point where the horizontal line made by the end point crosses the vertical line coming out from the front heading of the ship.
I'm really not sure though, i'm not even positive i'm going about it rightly with bezier curves.
If someone could give me some general guidance on a formula to solve this it'd be appreciated. :)
I'm trying to show a line which plots the course taken by a ship. It's in space so drag etc are not an issue but it can continue to accelerate.
I felt initally the answer was to take the end point and figure out the angle between the current heading and angle to point at the end point and divide that in half to find the mid point of a bezier curve. (in half because it would spend one half of the trip accelerating and one half decelerating to reach the correct heading)
the issue is though that because the ship is also moving forward as it rotates its position changes so it changes final angle.
I feel like a cubic bezier curve might be what I need with its 2 points and that PERHAPS one point is directly in front of its starting heading and the other is i'm not sure.
Alternatly maybe its just a simple squared bezier curve and the mid point is basically where assuming the point you want to end up at is somewhere in front of the ship. Its the point where the horizontal line made by the end point crosses the vertical line coming out from the front heading of the ship.
I'm really not sure though, i'm not even positive i'm going about it rightly with bezier curves.
If someone could give me some general guidance on a formula to solve this it'd be appreciated. :)
0 commentaires:
Enregistrer un commentaire