[Scilab-users] Fwd: avoid auto-zoom when rotating a 3D graphic

P M p.muehlmann at gmail.com
Wed Jul 7 08:49:46 CEST 2021


Dear,

is it possible to avoid the effect of auto-zoom / streching  when rotating
a graph in 3D-view?...see result of attached code.

My best guess is that one would have to set the a.margins according to the
actual a.rotation_angles for each frame....but is there a easier way?

Thank you,
Philipp

R=23;N=1000;nmax=1.1*6*N/%pi;// Random points in cube
2R*2R*2Rx=grand(nmax,1,'unf',-R,R);y=grand(nmax,1,'unf',-R,R);z=grand(nmax,1,'unf',-R,R);R2=R*R;//
Exclude points outside of sphere with radius RT=(x^2+y^2+z^2)>R2;M=[x
y z];M(T,:)=[];[r c]=size(M);M(((N+1):r), :)=[];x=M(:,1); y=M(:,2);
z=M(:,3); f = figure();f.background = 8;f.axes_size = [300,300]
s = linspace(5, 1, N);scatter3d(x,y,z,msizes=1,s);a = gca();a.box =
"off";a.axes_visible = ["off","off","off"];a.x_label.visible =
"off"a.y_label.visible = "off"a.z_label.visible = "off"
outgif = "Sphere03.gif";idGif = animaGIF(gcf(), outgif, 1,2);for i = 0:360;
    a.rotation_angles = [45, i];
    idGif = animaGIF(gcf(), idGif); // Adds the current figure to the
GIF streamend;animaGIF(idGif);    // Closes the GIF stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210707/63d260fd/attachment.htm>


More information about the users mailing list