Flip a plotted object horizontally?

2 次查看(过去 30 天)
So I'm plotting a moving object that basically moves like the old DVD "away" loading screen. The object basically bounces around the plane, but without exceeding the limits I've set. (-15 to 15 in the x and y direction). I'm basically trying to figure out how to make the object flip horizontally so that the nose of the object is actually going in the direction of the object. How would I go about this?
BTW I'm using a for loop to move the object along the graph.
If you have any questions or need any of my code, I'll post it.
thanks.

采纳的回答

Walter Roberson
Walter Roberson 2018-3-25
Suppose you define the object so that the nose is at the left, with the resting value being x = 0, y = 0. Then as it moves from right to left, adjust the graphic object's X and Y coordinates as
object.XData = nose_x + model_x_coordinates;
object.YData = nose_y + mode_y_coordinates;
and to move towards the right,
object.XData = nose_x - model_x_coordinates;
object.YData = nose_y + model_y_coordinates; %because you do not flip it upside down when it moves to the right

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by