From: Krzysztof on
Hi,

I`m writing some kind of flight data visualization program and I can not find a solution to see a moving airplane in x,y,z axes. At the simple 3D figure it works perfect. But I wanted to do it with a Aero Animation. The only effect I have is a plane rotation (psi, theta, phi).

Could You please look at the code and help me. Is it possible to do it Aero Animation?

function AnimacjaCallback(hObject, eventdata)
h = Aero.Animation;
h.FramesPerSecond = 20;
h.TimeScaling = 2000;
h.initialize();
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
h.Bodies{1}.TimeSeriesSource = dane_do_sym;
h.Camera.Offset = [-700,-1,0];
h.show();
h.play();
end
From: Saurabh Mahapatra on
Hi there,

Have you experimented with the following:

Simple script:

h = Aero.Animation;
h.FramesPerSecond = 20;
h.TimeScaling = 2000;
h.initialize();
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
h.Camera.Offset = [-700,-1,0];
animationCallback(handle(h), [])

And then the callback that you had:
function AnimationCallback(hObject, eventdata)
% hObject.Bodies{1}.TimeSeriesSource = dane_do_sym;
hObject.Camera.Offset = [-700,-1,0];
%hObject.show();
%hObject.play();
end
Uncomment the line ".show" to see the effect. The play will not work because we do not have access to dane_do_sym.

As I see the structure of the code and name of the function, I am guessing that you want to leave the animation piece separate for different simulations. if that be the case, then the declaration of the aero.animation object must happen outside the callback as it does not remember the previous settings when called again.

If you have any questions, please do not hesitate to contact me.

Thanks,

Saurabh

"Krzysztof " <daimon5(a)wp.pl> wrote in message <hhvj3s$ps6$1(a)fred.mathworks.com>...
> Hi,
>
> I`m writing some kind of flight data visualization program and I can not find a solution to see a moving airplane in x,y,z axes. At the simple 3D figure it works perfect. But I wanted to do it with a Aero Animation. The only effect I have is a plane rotation (psi, theta, phi).
>
> Could You please look at the code and help me. Is it possible to do it Aero Animation?
>
> function AnimacjaCallback(hObject, eventdata)
> h = Aero.Animation;
> h.FramesPerSecond = 20;
> h.TimeScaling = 2000;
> h.initialize();
> idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
> h.Bodies{1}.TimeSeriesSource = dane_do_sym;
> h.Camera.Offset = [-700,-1,0];
> h.show();
> h.play();
> end