Borrar filtros
Borrar filtros

3D ellipsoid turns 2D after rotation

1 visualización (últimos 30 días)
Kenton Young
Kenton Young el 6 de Ag. de 2020
Comentada: Kenton Young el 28 de Ag. de 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!!

Respuesta aceptada

Shadaab Siddiqie
Shadaab Siddiqie el 28 de Ag. de 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 comentario
Kenton Young
Kenton Young el 28 de Ag. de 2020
Thanks for the help! I found out my y-axis calculation resulted in a zero with the data I was using.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by