[sage-support] Making a movie or animation with 3d plotting of sage: animate() fails with 3D

466 views
Skip to first unread message

isurug

unread,
May 6, 2010, 6:34:46 AM5/6/10
to sage-support
Hello there,
First of all, a very big thank you for this piece of gold: sagemath.
Im loving it!
I could get it to do all i wanted so far without much less fuss! I
have now tried to make an animation or movie with it of some 3d plot i
have. I want to capture the changes occur in the plot with one
variable. I used animate() but it failed. I'd really appreciate if
anyone can shine some light regarding how this is possible in
Sagemath?

Thank you,
Isuru

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Ajay Rawat

unread,
May 6, 2010, 7:31:57 AM5/6/10
to sage-s...@googlegroups.com
use :
@interact
--
Ajay Rawat
Kalpakkam, IGCAR

-------------------------------------------------------------------------
Save Himalayas....
-------------------------------------------------------------------------

Marshall Hampton

unread,
May 6, 2010, 8:10:07 AM5/6/10
to sage-support
If you search this group for "animate" or "animation" you can see a
lot of other responses. One approach is to using ffmpeg to make a
movie out of a sequence of frames you save somewhere (e.g. the DATA
directory). Another is to use Jmol, but that requires learning a bit
more about Jmol since the functionality isn't wrapped in Sage well
yet. There has also been some recent progress in including the Theora
codec in Sage, which can be used with html5 (see
http://trac.sagemath.org/sage_trac/ticket/7298). Eventually the
animate command should be able to use that last option for 3d objects
but I'm not sure how long that's going to take.

-M. Hampton

Marshall Hampton

unread,
May 6, 2010, 8:14:06 AM5/6/10
to sage-support
I just noticed that saving 3d objects to a file has finally been
fixed: http://trac.sagemath.org/sage_trac/ticket/2872
That means we are one step closer to handling 3d animations. I can't
find a trac ticket that explicitly targets that but maybe I'm just
missing it.

-M. Hampton

On May 6, 7:10 am, Marshall Hampton <hampto...@gmail.com> wrote:
> If you search this group for "animate" or "animation" you can see a
> lot of other responses.  One approach is to using ffmpeg to make a
> movie out of a sequence of frames you save somewhere (e.g. the DATA
> directory).  Another is to use Jmol, but that requires learning a bit
> more about Jmol since the functionality isn't wrapped in Sage well
> yet.  There has also been some recent progress in including the Theora
> codec in Sage, which can be used with html5 (seehttp://trac.sagemath.org/sage_trac/ticket/7298).  Eventually the

Niles

unread,
Apr 7, 2012, 4:41:43 PM4/7/12
to sage-s...@googlegroups.com
I've been thinking about working on basic 3D animations for Sage; I haven't yet found an open ticket either.  On AskSage, I gave an example showing how to hack the current animation functionality to animate 3D plots:

http://ask.sagemath.org/question/1275/interact-3d-plotpolyhedron?answer=1999#1999

The idea is to make a dummy animation, with the same number of frames that you want, and then *replace* the dummy animation frames with the ones you want to use.  When you call ".show()", your dummy animation object will then work out the necessary command for convert and produce a gif animation for you.

Marshall:  Perhaps you and I (and other interested parties) should discuss how to best implement 3D animations either on sage-devel or on the appropriate ticket.  My thinking has been that "animate()" should work for any iterator of objects which can save to an image format.  Currently "animate(w)" tries to call "plot()" on the items in w, and I was thinking of just replacing this with a try/except block that would call something like "save(tmp_%08d.png)" instead, and fall back on plot if that fails.  Maybe you have more developed ideas though?

-Niles
> > To unsubscribe from this group, send email to sage-support+unsubscribe@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/sage-support
> URL:http://www.sagemath.org

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support+unsubscribe@googlegroups.com

Niles

unread,
Apr 7, 2012, 4:44:51 PM4/7/12
to sage-s...@googlegroups.com
Ack!  I found this thread while looking for progress on 3D animation, and didn't notice that it's *two years old*.  Anyway, I am indeed thinking of working on this.

Tobias Weich

unread,
Apr 9, 2012, 10:30:59 AM4/9/12
to sage-s...@googlegroups.com
Great! This hack is not only useful for 3D-Animation but also solves a problem I encountered some days ago: Making an animation where each frame consists of an graphics_array. I'd really appreciate if animate would be improved this way. However, being quite new to Sage and Python I will not be much help in developing this feature. Maybe I could help testing it a little bit if necessary...

Nils Bruin

unread,
Apr 10, 2012, 1:46:43 AM4/10/12
to sage-s...@googlegroups.com
On Monday, April 9, 2012 7:30:59 AM UTC-7, Tobias Weich wrote:
Great! This hack is not only useful for 3D-Animation but also solves a problem I encountered some days ago: Making an animation where each frame consists of an graphics_array. I'd really appreciate if animate would be improved this way. However, being quite new to Sage and Python I will not be much help in developing this feature. Maybe I could help testing it a little bit if necessary...

You might want to check another sage-support thread which dealt with exactly the same problem:

https://groups.google.com/d/msg/sage-support/B_BEoDKUD7o/ufZ8H_O_uvEJ

The command to put the frames together isn't particularly difficult, so you can skip creating the dummy animation.

Niles Johnson

unread,
Apr 11, 2012, 8:18:48 AM4/11/12
to sage-s...@googlegroups.com
For reference:  I've opened a ticket for this now at

http://trac.sagemath.org/sage_trac/ticket/12827

Some ideas for a fix are there, and more of the discussion is on a thread at sage-devel:

https://groups.google.com/forum/?fromgroups#!topic/sage-devel/9TzVOj70ADU
Reply all
Reply to author
Forward
0 new messages