Dear all,
I am doing project about train simulation, I need literature about how to draw moving objects like cars in matlab. Thank you

답변 (1개)

KSSV
KSSV 2020년 12월 15일

0 개 추천

What literature you will get on drawing moving objects? It is simple ain't it? You need to have a object first i.e. you need to have a the coordinate points (x,y) of the object. You need to have the tract i.e. in which direction you want to move the object..again this would be the set of points (x,y). Add each point of the tract (xi,yi) to all the points of object, you will get your oblject move.
May be something like this:
car = [0 0; 1 0; 1 1; 0 1] ;
% track
th = linspace(0,2*pi) ;
y = 3*sin(th) ;
% move the object
for i = 1:length(th)
P = car+[th(i) y(i)] ;
patch(P(:,1),P(:,2),'r')
drawnow
end

댓글 수: 4

Ivan Dwi Putra
Ivan Dwi Putra 2020년 12월 15일
i like to make animation like in the link Animation
Ivan Dwi Putra
Ivan Dwi Putra 2020년 12월 15일
i need the animation that attach to my train model
KSSV
KSSV 2020년 12월 15일
Yes it canbe done.....you need to follow what I said. Read about affine transofrmations.
Ivan Dwi Putra
Ivan Dwi Putra 2020년 12월 15일
ok thank tou. I will learn first

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Animation에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2020년 12월 15일

댓글:

2020년 12월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by