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

Stéphane Mottelet stephane.mottelet at utc.fr
Thu Jul 15 10:22:12 CEST 2021


Hi Philip,

Here is a possible implementation for the next major release of Scilab (6.2)

https://codereview.scilab.org/#/c/21801/

Take a look at the video and tell me if it is OK for you. However, there 
are still some glitches which have to fo be fixed (e,g, problems when 
zooming in isoview mode) but we have some time to think about it.

S.

Le 07/07/2021 à 08:49, P M a écrit :
>
> 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*2R
> x=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 R
> T=(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 stream
> end;
> animaGIF(idGif);     // Closes the GIF stream
>
>
>
>
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210715/72e6f0fd/attachment.htm>


More information about the users mailing list