An option to create a rotation animation for the GraphicsObject. 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]); anim2=rotation(-0.1,[0,0,1],[0,0]);); anim3 = { 5 => {5 => anim1, 5 => anim2}, 10 => anim1 }; |
i3 : gList(Polygon{{[-1,0],[1,0.1],[1,-0.1]},"fill"=>"red",AnimMatrix=>anim1},Circle{[1,0],0.1},Circle{[0,0],1}) o3 = 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 | PointList => {| -1 |, | 1 |, | 1 |} Radius => .1 Radius => 1 | 0 | | .1 | | -.1 | style => MutableHashTable{} style => MutableHashTable{} | 0 | | 0 | | 0 | | 1 | | 1 | | 1 | style => MutableHashTable{...1...} style => MutableHashTable{} o3 : GraphicsList |
i4 : gList(Polygon{{[-1,0],[1,0.1],[1,-0.1]},"fill"=>"red",AnimMatrix=>anim3},Circle{[1,0],0.1},Circle{[0,0],1}) o4 = 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 | PointList => {| -1 |, | 1 |, | 1 |} Radius => .1 Radius => 1 | 0 | | .1 | | -.1 | style => MutableHashTable{} style => MutableHashTable{} | 0 | | 0 | | 0 | | 1 | | 1 | | 1 | style => MutableHashTable{...1...} style => MutableHashTable{} o4 : GraphicsList |
The object AnimMatrix is a symbol.