Effacer les filtres
Effacer les filtres

3D ellipsoid turns 2D after rotation

1 vue (au cours des 30 derniers jours)
Kenton Young
Kenton Young le 6 Août 2020
Commenté : Kenton Young le 28 Août 2020
Hello!
I am currently working on a program that requires the rotation of an ellipsoid in 3D space. Previous questions like this lead me to the "rotate" function where I could input an angle for the three axes. The issue is when I rotate about either the y or z axes, my ellipsoid turns 2D. When I rotate about both the y and z axes, the surface turns into a line. This rotation works fine around the x-axis.
Code Below:
% Get fz ellipsoid points
[ex,ey,ez] = ellipsoid(xc,yc,zc,foci2end,fzradius,fzradius);
figure(1)
hold all;
% Fresnel Zone
fresnelzone = surf(ex,ey,ez); % Surface Plot
set(fresnelzone,'EdgeColor','none'); % Edge Color/Transparency Settings
set(fresnelzone,'FaceAlpha','.4');
% Rotate Ellipsoid
rotate(fresnelzone,[1 0 0], angle_x);
rotate(fresnelzone,[0 1 0], angle_y);
rotate(fresnelzone,[0 0 1], angle_z);
% Plot Label/View Settings
xlabel('X-axis');
ylabel('Y-axis');
zlabel('Z-axis');
view(3);
Thanks for any help!!

Réponse acceptée

Shadaab Siddiqie
Shadaab Siddiqie le 28 Août 2020
I have implemented the function and found even a rotation across y or z axis, I am still getting an 3D ellipsoid. Note that you can view the ellipsoid from different angles with the help of the cursor (mouser). Also make sure that neither of the semi-axis lengths are zero. For more information please visit https://in.mathworks.com/help/matlab/ref/surf.html
  1 commentaire
Kenton Young
Kenton Young le 28 Août 2020
Thanks for the help! I found out my y-axis calculation resulted in a zero with the data I was using.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by