next | previous | forward | backward | up | top | index | toc | Macaulay2 website
VectorGraphics :: AnimMatrix

AnimMatrix -- Create a rotation animation matrix

Description

An option to create a rotation animation for the VectorGraphics 3d object. The value can be a single 4x4 matrix, or a list which is cycled. The syntax n => ... can be used to repeat a sequence n times (where 0 means infinity). The animation automatically loops (use 0 => \{ \} to stop!) In order for the animation to work, VectorGraphics.css and VectorGraphics.js must be included in the web page.

i1 : (anim1=rotation(0.1,(0,0,1),(0,0,0)); anim2=rotation(-0.1,(0,0,1),(0,0,0)); anim3 = { 5 => {5 => anim1, 5 => anim2}, 10 => anim1 });
i2 : gList(Polygon{{(-1,0),(1,0.1),(1,-0.1)},"fill"=>"red",AnimMatrix=>anim1},Circle{(1,0),0.1},Circle{(0,0),1})

o2 = GraphicsList{cache => CacheTable{}                                                                                                        }
                  Contents => {Polygon{AnimMatrix => | .995004  -.0998334 0 0 |}, Circle{cache => CacheTable{}}, Circle{cache => CacheTable{}}}
                                                     | .0998334 .995004   0 0 |          Center => | 1 |                Center => | 0 |
                                                     | 0        0         1 0 |                    | 0 |                          | 0 |
                                                     | 0        0         0 1 |                    | 0 |                          | 0 |
                                       cache => CacheTable{}                                       | 1 |                          | 1 |
                                       fill => red                                       Radius => .1                   Radius => 1
                                       Points => {| -1 |, |  1 |, |  1  |}
                                                  |  0 |  | .1 |  | -.1 |
                                                  |  0 |  |  0 |  |  0  |
                                                  |  1 |  |  1 |  |  1  |

o2 : GraphicsList
i3 : gList(Polygon{{(-1,0),(1,0.1),(1,-0.1)},"fill"=>"red",AnimMatrix=>anim3},Circle{(1,0),0.1},Circle{(0,0),1})

o3 = GraphicsList{cache => CacheTable{}                                                                                                                                                                                         }
                  Contents => {Polygon{AnimMatrix => {5 => {5 => | .995004  -.0998334 0 0 |, 5 => | .995004   .0998334 0 0 |}, 10 => | .995004  -.0998334 0 0 |}}, Circle{cache => CacheTable{}}, Circle{cache => CacheTable{}}}
                                                                 | .0998334 .995004   0 0 |       | -.0998334 .995004  0 0 |         | .0998334 .995004   0 0 |           Center => | 1 |                Center => | 0 |
                                                                 | 0        0         1 0 |       | 0         0        1 0 |         | 0        0         1 0 |                     | 0 |                          | 0 |
                                                                 | 0        0         0 1 |       | 0         0        0 1 |         | 0        0         0 1 |                     | 0 |                          | 0 |
                                       cache => CacheTable{}                                                                                                                        | 1 |                          | 1 |
                                       fill => red                                                                                                                        Radius => .1                   Radius => 1
                                       Points => {| -1 |, |  1 |, |  1  |}
                                                  |  0 |  | .1 |  | -.1 |
                                                  |  0 |  |  0 |  |  0  |
                                                  |  1 |  |  1 |  |  1  |

o3 : GraphicsList

For the programmer

The object AnimMatrix is a symbol.