0
$\begingroup$

I'd like to make a exportable film (in some format like .avi or .mp4, something playable on most computers) where each frame is a Graphics3D output. For example, we might generate frames in the following way:

polytopeSize = 3;

numFrames = 10;  
frameSet = Table[Graphics3D[Table[Translate[Scale[PolyhedronData["Dodecahedron", "Faces"], polytopeSize], RandomReal[{0, 5}, 3]], {i, 1, 5}]], {k, 1, numFrames}];

I'd like to be able to set a time delay individually for each frame:

frameSetTimeDelaysInSeconds = RandomReal[{0,1}, numFrames];

Is this possible?

$\endgroup$
1
  • 1
    $\begingroup$ See this question for a solution for non-GIF files. $\endgroup$
    – cormullion
    Nov 11 '13 at 11:24
1
$\begingroup$

Here's an idea that could be worth exploring:

table = Flatten[
  MapThread[
    Table[#1, {Round@#2}] &, {frameSet, 30 * frameSetTimeDelaysInSeconds}]];

Export["frameset.mov", table]

This just duplicates frames for as many times as necessary - inelegant, I suppose, but it might do.

$\endgroup$
0
$\begingroup$

The hyperlink from cormullion is cormullion is ideal.

A table of "DisplayDurations" can be used for animated gifs.

AVI's tend to be very large and you can use other software to compress. MOV/QT files are reasonable.

Here is away to have variable frame durations by padding frames:

framerate = 15;
framnum = Round[framerate frameSetTimeDelaysInSeconds]
film = Join @@ MapThread[Table[#1, {#2}] &, {frameSet, framnum}];

You can then export:

Export["yourfilename.avi", film,"FrameRate" -> framerate]

This will be a large file.

For quicktime:

Export["yourfilename.mov", film,  "FrameRate" -> framerate]

I note the default frame rate for quicktime is 15fps...I just illustrate potential to change (play with).

An example is here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.