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.Thu, 17 May 2012 10:35:17 +02003d animation with tachyonhttps://ask.sagemath.org/question/8947/3d-animation-with-tachyon/Hello!
I'm trying to create a 3d animations, frame per frame. I've discovered that tachyon plotter is very usefull to create images. But after that, I'm unable to make it as animation.
For example, I have copied a code and generate some scenes with tachyon with this:
saved = []
for j in srange(-0.9,1,0.3):
t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0))
t.light((4,3,2), 0.2, (1,1,1))
t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0))
t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0))
t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0))
k=0
for i in srange(-1,j,0.05):
k += 1
t.sphere((i,i^2-0.5,i^3), 0.1, 't%s'%(k%3))
saved.append(t)
In "saved" array I have all the png of the animation I want to do, and I can view it with saved[i].show().
I tried to unite all the frames with the command animate:
animate(saved[i].show() for i in range(0,len(saved)))
But it didn't work. What other alternatives do I have? (without using ffmpeg)
Thank you!RoctivThu, 17 May 2012 10:35:17 +0200https://ask.sagemath.org/question/8947/animate 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.nilesSat, 04 Sep 2010 10:59:25 +0200https://ask.sagemath.org/question/7666/