[Scilab-users] How can I make a movie that shows how the sphere rotates around the z-axis?
Heinz Nabielek
heinznabielek at me.com
Fri Jul 2 23:29:47 CEST 2021
No. How to do it?
I have downloaded.... but then what?
/Users/heinz/Downloads/animaGIF_1.0_61-bin
-rw-rw-r--@ 1 heinz staff 1386 Feb 28 2020 DESCRIPTION
-rw-rw-r--@ 1 heinz staff 407469 Jul 22 2019 animaGIF_1.0.pdf
-rw-rw-r--@ 1 heinz staff 396 Jul 21 2019 changelog.txt
drwxrwxr-x@ 3 heinz staff 96 Feb 28 2020 etc
drwxrwxr-x@ 3 heinz staff 96 Feb 28 2020 jar
-rw-rw-r--@ 1 heinz staff 22677 Jul 21 2019 license.txt
-rw-rw-r--@ 1 heinz staff 594 Feb 28 2020 loader.sce
drwxrwxr-x@ 6 heinz staff 192 Feb 28 2020 locales
drwxrwxr-x@ 10 heinz staff 320 Feb 28 2020 macros
-rw-rw-r--@ 1 heinz staff 539 Jul 21 2019 readme.txt
drwxrwxr-x@ 5 heinz staff 160 Feb 28 2020 tests
-rw-rw-r--@ 1 heinz staff 990 Feb 28 2020 unloader.sce
> On 02.07.2021, at 23:25, Stéphane Mottelet <stephane.mottelet at utc.fr> wrote:
>
> Heinz did you manage the offline install of animaGIF ?
>
> Le 02/07/2021 à 23:03, Heinz Nabielek a écrit :
>> Thanks. The rotating graphics works well, but on my Mac with Scilab 6.1, already the first line "scicv_Init()" bumps...
>> What to do?
>> Heinz
>>
>>
>>
>>> On 02.07.2021, at 10:50, P M <p.muehlmann at gmail.com> wrote:
>>>
>>> .... the rotation can be realised by changing "rotation_angles" in a for loop
>>>
>>> .. creating the movie...maybe use scicv?
>>>
>>> in a for loop
>>> - set rotation angle
>>> - display the graph
>>> - save the actual graph as an image
>>> - reload the image
>>> - add image to frame
>>>
>>>
>>> see code below:
>>> Only draw back here: the avi-file could not be played afterwards..and had only 6kB in size.
>>>
>>> I guess, this is because ffmpeg is missing on my PC, but I am pretty sure that some scicv expert could solve this issue.
>>>
>>> BR
>>> Philipp
>>>
>>> scicv_Init();
>>>
>>>
>>>
>>> R=23;
>>> N=14500;
>>>
>>> r=grand(N,1,'unf',0,R);
>>> phi=grand(N,1,'unf',0,2*%pi);
>>> theta=grand(N,1,'unf',0,%pi);
>>> x=r.*cos(phi).*sin(theta);
>>> y=r.*sin(phi).*sin(theta);
>>> z=r.*cos(theta);
>>>
>>>
>>>
>>> f = figure();
>>> f.background = 8;
>>> scatter3d(x,y,z,msizes=4);
>>> a = gca();
>>>
>>>
>>>
>>> // create the avi file
>>> videoWriter = new_VideoWriter("F:\testAvi.avi", CV_FOURCC('M', 'P', '4', '2'), 25, [400, 400]);
>>>
>>>
>>>
>>> for i = 0:360
>>>
>>> a.rotation_angles = [60, i];
>>>
>>> // save the graph as image
>>>
>>> xs2png(f.figure_id, 'F:\testImg.bmp');
>>>
>>> // read image
>>>
>>> img = imread('F:\testImg.png', CV_LOAD_IMAGE_GRAYSCALE);
>>>
>>>
>>> // add image as frame to avi
>>>
>>> VideoWriter_write(videoWriter, img);
>>>
>>>
>>>
>>> end
>>>
>>>
>>>
>>> // free avi from memory
>>> delete_VideoWriter(videoWriter);
>>>
>>>
>>>
>>>
>>>
>>> Am Fr., 2. Juli 2021 um 00:22 Uhr schrieb Heinz Nabielek <heinznabielek at me.com>:
>>> Colleagues:
>>>
>>> the code below generates 14,500 random points in a spherical volume.
>>> How can I make a movie that shows how the sphere rotates around the z-axis? And how do I store the animation? animaGIF does not exist on my Scilab 6.1 in my macOS 10.15.7
>>>
>>> Heinz
>>>
>>>
>>> R=23;
>>> N=14500;
>>> r=grand(N,1,'unf',0,R);
>>> phi=grand(N,1,'unf',0,2*%pi);
>>> theta=grand(N,1,'unf',0,%pi);
>>> x=r.*cos(phi).*sin(theta);
>>> y=r.*sin(phi).*sin(theta);
>>> z=r.*cos(theta);
>>> scatter3d(x,y,z,msizes=4);
>>> gca().rotation_angles = [60, 60];
>>>
>>>
>>> ______________
>>> Dr Heinz Nabielek
>>> Schüttelstrasse 77A/11
>>> A-1020 Wien, Österreich
>>> Tel +43 1 276 56 13
>>> cell +43 677 616 349 22
>>> heinznabielek at me.com
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>> _______________________________________________
>> 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
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
More information about the users
mailing list