How to change color of imported geometry from .mat file?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi guys!
The professor of flight dynamics course has given to me a code to plot an aircraft in a refernce system. I import in the code the .mat file in which there is the aircraft geometry but I cannot change the default color (red) to another color (for example cyan).
This is the code:
%% Setup the figure/scene
h_fig2 = figure(2);
light('Position',[2 4 -4],'Style','local');
% Trick to have Ze pointing downward and correct visualization
set(gca,'XDir','reverse'); set(gca,'ZDir','reverse');
grid on; hold on;
%% Load aircraft shape
shapeScaleFactor_bis = 1.0;
shape_bis = loadAircraftMAT('Embraer_phenom_100.mat', shapeScaleFactor_bis);
%% Set the aircraft in place
% Posision in Earth axes
vXYZe = [2,2,-2];
% psi, theta, phi -> 'ZYX'
vEulerAngles = convang([20,10,0],'deg','rad');
% Observer point-of-view
theView = [120 20];
% body axes settings
bodyAxesOptions.show = true;
bodyAxesOptions.magX = 2.0*shapeScaleFactor_bis;
bodyAxesOptions.magY = 2.0*shapeScaleFactor_bis;
bodyAxesOptions.magZ = 1.5*shapeScaleFactor_bis;
bodyAxesOptions.lineWidth = 2.5;
plotBodyE(h_fig2, shape_bis, ...
vXYZe, vEulerAngles, ...
bodyAxesOptions, theView);
Edit: I discovered that I can change the color in the function plotBodyE.m, but I wish to change the color inside the code that I've attached here (without modyfing the function). Can you help me?
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Guidance, Navigation, and Control (GNC) dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!