Filter löschen
Filter löschen

camera fly-through effect

5 Ansichten (letzte 30 Tage)
Hs5555
Hs5555 am 12 Jul. 2018
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?

Antworten (0)

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by