camera fly-through effect

2 次查看(过去 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