Object Rotation using Image Rotation

Discussion in 'MATLAB' started by Jonathan Stevenson, Apr 19, 2006.

  1. I'm trying to rotate a small graphic of an object against a much
    larger background. I believe that this is precisely what the
    "rotate" or "imrotate" functions should do. However, the best I've
    been able to do is have the object "orbit" the center of the figure
    (i.e. it's orientation actually doesn't change), using this syntax:

    % Update car positions
    rot = rot - omega*dt;

    % Refresh car sprites

    Where veh1 was created beforehand using this syntax:

    % Red Car
    Car1 = imread('red_car.bmp','bmp');

    % Initial Positions (and angle)

    % Add Car to image
    veh1 = image('Cdata', Car1, 'XData', x1, 'YData', y1);

    What am I doing wrong? Is there some property (say of the object)
    that may be stopping the orientation from changing?
    Jonathan Stevenson, Apr 19, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.