Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Animating an object that moves with a variable velocity

Subject: Animating an object that moves with a variable velocity

From: Liana

Date: 25 Apr, 2011 07:00:05

Message: 1 of 3

Hello,

I would like to make animation of the cylinder that moves along some path with a predefined variable velocity. The velocity is defined for each interval in the path:
vi => [xi; xi+delta], i = 1...N, where N is a number of equally sized intervals in the path.

Currently, I've implemented the animation in the following way:
for j = 1 : PathLength
    if j > 1, delete(h1); end
    h1 = surf(X(:,j),Y(:,j),Z(:,j)); % cylinder coordinates
    set(h1, 'FaceColor', 'flat');
    refreshdata;
    drawnow;
end

However, this code assumes that the cylinder is moving with a constant velocity. So, how can I change the velocity in the animation, if I have the predefined velocity vector?

Thanks.

Subject: Animating an object that moves with a variable velocity

From: ImageAnalyst

Date: 25 Apr, 2011 13:30:03

Message: 2 of 3

Insert a pause() with the proper delay into your loop.

Subject: Animating an object that moves with a variable velocity

From: Liana

Date: 26 Apr, 2011 19:46:21

Message: 3 of 3

Thank you!

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <534b70e6-fc2a-4ca8-a335-d5b0afd933ce@u12g2000prn.googlegroups.com>...
> Insert a pause() with the proper delay into your loop.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us