camera fly-through effect

조회 수: 1 (최근 30일)
Hs5555
Hs5555 2018년 7월 12일
Hi, I would like to implement the fly-through effect as shown in this nice example: https://ch.mathworks.com/help/matlab/visualize/example-moving-the-camera-through-a-scene.html
I've attached 4 files with my data variables. First I created a figure from hm variable by using surf function: surf(hm); Then, I defined an animated line from x,y and z variables and displayed on the hm figure as follows:
curve = animatedline; curve.LineWidth = 6; curve.Color = [ 1 0 1];
for i=1:length(x) addpoints(curve, x(i), y(i), z(i)); drawnow; end
Then, I wanted to implement the fly-through effect so that the camera will move along the line. I tried this code piece I took from the example above and I slightly modified it:
for i=1:length(x) campos([(x(i) -5),(y(i)-5),0]) camtarget([x(i),y(i),z(i)]) drawnow end
But the camera doesnt move as I intended.
what am i doing wrong?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by