ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 05 Sep 2010 00:55:36 +0200animate 3d plots?https://ask.sagemath.org/question/7666/animate-3d-plots/Is there an animation function for 3d plots? Specifically, I'm looking to animate some plots drawn with Tachyon, but I don't see any animation functions either in the [Tachyon documentation](http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html) or in the [3d base classes documentation](http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html). I have seen that there is an animate function for [2d plots](http://www.sagemath.org/doc/reference/sage/plot/animate.html), but it says that the input needs to be a "graphics object", and I don't think Tachyon objects are recognized as such. So maybe modifying the 2d animation functions could do what I want, but is there something else already available?
For an example, an animation where the curve changes color from magenta to white would be great:
<pre>
sage: f = lambda t: (t,t^2,t^3)
sage: t = Tachyon(camera_center=(5,0,4))
sage: t.texture('t')
sage: t.light((-20,-20,40), 0.2, (1,1,1))
sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
sage: t.show()
</pre>
p.s. If this **is** already available, I'll volunteer to add information about it to the Tachyon documentation.Sat, 04 Sep 2010 10:59:25 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/Comment by ccanonc for <p>Is there an animation function for 3d plots? Specifically, I'm looking to animate some plots drawn with Tachyon, but I don't see any animation functions either in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon documentation</a> or in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html">3d base classes documentation</a>. I have seen that there is an animate function for <a href="http://www.sagemath.org/doc/reference/sage/plot/animate.html">2d plots</a>, but it says that the input needs to be a "graphics object", and I don't think Tachyon objects are recognized as such. So maybe modifying the 2d animation functions could do what I want, but is there something else already available?</p>
<p>For an example, an animation where the curve changes color from magenta to white would be great:</p>
<pre>sage: f = lambda t: (t,t^2,t^3)
sage: t = Tachyon(camera_center=(5,0,4))
sage: t.texture('t')
sage: t.light((-20,-20,40), 0.2, (1,1,1))
sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
sage: t.show()
</pre>
<p>p.s. If this <strong>is</strong> already available, I'll volunteer to add information about it to the Tachyon documentation.</p>
https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22705#post-id-22705Could an interact do this? (The display/loop part, not the saving part.)Sat, 04 Sep 2010 12:31:48 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22705#post-id-22705Comment by ccanonc for <p>Is there an animation function for 3d plots? Specifically, I'm looking to animate some plots drawn with Tachyon, but I don't see any animation functions either in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon documentation</a> or in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html">3d base classes documentation</a>. I have seen that there is an animate function for <a href="http://www.sagemath.org/doc/reference/sage/plot/animate.html">2d plots</a>, but it says that the input needs to be a "graphics object", and I don't think Tachyon objects are recognized as such. So maybe modifying the 2d animation functions could do what I want, but is there something else already available?</p>
<p>For an example, an animation where the curve changes color from magenta to white would be great:</p>
<pre>sage: f = lambda t: (t,t^2,t^3)
sage: t = Tachyon(camera_center=(5,0,4))
sage: t.texture('t')
sage: t.light((-20,-20,40), 0.2, (1,1,1))
sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
sage: t.show()
</pre>
<p>p.s. If this <strong>is</strong> already available, I'll volunteer to add information about it to the Tachyon documentation.</p>
https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22706#post-id-22706Interesting question. The 2d plots seem to be animated by ImageMagick. For 3d, a different lib (as you mention). Saving a keyframe animation involves dumping the renderbuffer/framebuffer for those times. I will look at this too.Sat, 04 Sep 2010 12:26:54 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22706#post-id-22706Answer by ccanonc for <p>Is there an animation function for 3d plots? Specifically, I'm looking to animate some plots drawn with Tachyon, but I don't see any animation functions either in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon documentation</a> or in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html">3d base classes documentation</a>. I have seen that there is an animate function for <a href="http://www.sagemath.org/doc/reference/sage/plot/animate.html">2d plots</a>, but it says that the input needs to be a "graphics object", and I don't think Tachyon objects are recognized as such. So maybe modifying the 2d animation functions could do what I want, but is there something else already available?</p>
<p>For an example, an animation where the curve changes color from magenta to white would be great:</p>
<pre>sage: f = lambda t: (t,t^2,t^3)
sage: t = Tachyon(camera_center=(5,0,4))
sage: t.texture('t')
sage: t.light((-20,-20,40), 0.2, (1,1,1))
sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
sage: t.show()
</pre>
<p>p.s. If this <strong>is</strong> already available, I'll volunteer to add information about it to the Tachyon documentation.</p>
https://ask.sagemath.org/question/7666/animate-3d-plots/?answer=11621#post-id-11621[http://wiki.sagemath.org/interact/graphics#Interactive3dplotting][1]
Maybe if interact code could be modified to loop, it would get the desired effect? I haven't used interact.
[1]: http://wiki.sagemath.org/interact/graphics#Interactive3dplottingSat, 04 Sep 2010 12:37:50 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/?answer=11621#post-id-11621Comment by ccanonc for <p><a href="http://wiki.sagemath.org/interact/graphics#Interactive3dplotting">http://wiki.sagemath.org/interact/graphics#Interactive3dplotting</a></p>
<p>Maybe if interact code could be modified to loop, it would get the desired effect? I haven't used interact.</p>
https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22704#post-id-22704mma does looping animations, so this feature/enhancement follows the "can mma do it?" rule; assuming it can't already be done in Sage.Sat, 04 Sep 2010 13:17:46 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/?comment=22704#post-id-22704Answer by mhampton for <p>Is there an animation function for 3d plots? Specifically, I'm looking to animate some plots drawn with Tachyon, but I don't see any animation functions either in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon documentation</a> or in the <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html">3d base classes documentation</a>. I have seen that there is an animate function for <a href="http://www.sagemath.org/doc/reference/sage/plot/animate.html">2d plots</a>, but it says that the input needs to be a "graphics object", and I don't think Tachyon objects are recognized as such. So maybe modifying the 2d animation functions could do what I want, but is there something else already available?</p>
<p>For an example, an animation where the curve changes color from magenta to white would be great:</p>
<pre>sage: f = lambda t: (t,t^2,t^3)
sage: t = Tachyon(camera_center=(5,0,4))
sage: t.texture('t')
sage: t.light((-20,-20,40), 0.2, (1,1,1))
sage: t.parametric_plot(f,-5,5,'t',min_depth=6)
sage: t.show()
</pre>
<p>p.s. If this <strong>is</strong> already available, I'll volunteer to add information about it to the Tachyon documentation.</p>
https://ask.sagemath.org/question/7666/animate-3d-plots/?answer=11622#post-id-11622This has been a desired feature for a long time. I use ffmpeg to animate tachyon plots; for some discussion of that see:
[http://groups.google.com/group/sage-support/browse_thread/thread/eb00dc7727701879][1]
Because ffmpeg has some patent issues in the US (at least I think it does, I'm not an expert on that sort of thing) it can't be included in Sage. A promising alternative is to animate tachyon-created images in the browser by other means. This is the goal of a trac ticket already:
[http://trac.sagemath.org/sage_trac/ticket/7298][2]
Seems totally possible, but nobody has pushed it to completion.
[1]: http://groups.google.com/group/sage-support/browse_thread/thread/eb00dc7727701879
[2]: http://trac.sagemath.org/sage_trac/ticket/7298Sun, 05 Sep 2010 00:55:36 +0200https://ask.sagemath.org/question/7666/animate-3d-plots/?answer=11622#post-id-11622