Effacer les filtres
Effacer les filtres

camera fly-through effect

2 vues (au cours des 30 derniers jours)
Hs5555
Hs5555 le 12 Juil 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?

Réponses (0)

Catégories

En savoir plus sur Animation dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by