help-3dldf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-3dldf] Re: ANEEMATE


From: Laurence Finston
Subject: [help-3dldf] Re: ANEEMATE
Date: Tue, 3 May 2005 17:09:20 +0200 (MEST)

Hello Nobre et al,

I've managed to create my first MPEG animation.  I've put in on the
GNU 3DLDF website:  `http://www.gnu.org/software/3dldf/LDF.html'.
It's close to the top, under the image of a sphere, which will rotate
if you press the "start" button (my first JavaScript animation).

I've used the following Emacs-Lisp code to generate the MPEG file.

The image is a bit blurry, which is especially noticeable with
respect to the text (in `cmbx12' scaled \magstep3').
I think it should be possible to
generate the images in the correct size in the first place,
or close enough so that `convert -geometry 640x480!' doesn't
cause too much distortion.  Trying this will be my next task.
I haven't yet tried using `mencoder'.

There seem to be advantages and disadvantages to using both
MPEG and JavaScript --- neither is in all respects superior.
I still find it very useful to put all of the images in a TeX file
and flip through them using Ghostview.

Thanks for figuring out how to generate MPEGs and teaching me
how to use your code.  I think figuring it out
must have been a lot of work.

Have you experimented with adding a soundtrack?

Laurence

*****************************************************************

;; generate.el

;; This file is part of GNU 3DLDF, a package for three-dimensional drawing. @>
;; Copyright (C) 2003, 2004, 2005 The Free Software Foundation @>

  [...]

;; * (1) The Emacs-Lisp code in this file can be used to generate
;;       an MPEG animation from Encapsulated PostScript (EPS) files
;;       generated by using GNU 3DLDF and MetaPost.
;;       LDF 2005.05.03.

;;       I am indebted to L. Nobre G.
;;       and his ANEEMATE package, which he has released under
;;       the GNU General Public License.
;;       It was Nobre who developed
;;       the method used in this Emacs-Lisp code.
;;       ANEEMATE is available from
;;       http://matagalatlante.org/nobre/aneemate/nodocs/aneematepage.html
;;
;;       LDF 2005.05.03.


;; * (1) This code will need to be adapted to conditions
;;       LDF 2005.05.03.

  ;; Copy the EPS files from wherever they are.
  ;; LDF 2005.05.03.

  (shell-command (concat "cp ~/3DLDF/CWEB/3DLDFmp.* ."))

  ;; Strip off the borders to create structured PostScript
  ;; files exactly the same size as the images.
  ;; Additionally, this takes care of the problem that
  ;; `convert' can't handle EPS files generated from MetaPost files
  ;; which include labels that use Metafont fonts.  It can handle
  ;; the structured PostScript files.
  ;;
  ;; You will have to change the numbers used, if you change
  ;; the number of frames, and/or their numbering.
  ;;
  ;; LDF 2005.05.03.

  (shell-command (concat "cnepspng 3DLDFmp 1 197 0pt 0pt"))

  (let (i zeroes i-string command-string)
    (setq i 1)

    (while (< i 198)

      ;; Setting `zeroes' could be made more efficient.
      ;; LDF 2005.05.03.

      (if (< i 10)
          (setq zeroes "000"))

      (if (and (> i 10) (< i 100))
          (setq zeroes "00"))

      (if (>= i 100)
          (setq zeroes "0"))

      (setq i-string (number-to-string i))

      ;; It would probably work to pass the PS files to `convert'
      ;; rather than the PNG files.
      ;; LDF 2005.05.03.

      (setq command-string
            (concat "convert -geometry 640x480! 3DLDFmp_"
                    i-string ".png ppm:frames/framppm."
                    zeroes i-string))

      (message (concat "Executing `" command-string "'."))
      (sit-for .125)
      (shell-command command-string)

      (setq i (1+ i))

      ) ;; while

    ;; Generate the MPEG file.  `encode.Params' must be changed
    ;; to reflect the number of frames, if you change this.
    ;; LDF 2005.05.03.

    (setq command-string
          "ppmtompeg -no_frame_summary -float_dct encode.Params")

    (message command-string)
    (sit-for .125)

    (shell-command command-string)

    ) ;; let




reply via email to

[Prev in Thread] Current Thread [Next in Thread]