0

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?

user10456
  • 133
  • 4

2 Answers2

1

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.

cormullion
  • 24,243
  • 4
  • 64
  • 133
0

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

ubpdqn
  • 60,617
  • 3
  • 59
  • 148