The GNU 3DLDF Video Page

Author: Laurence D. Finston

This copyright notice applies to the text and source code of this web site, and the graphics that appear on it. The software described in this text has its own copyright notice and license, which can be found in the distribution itself.

Copyright (C) 2023, 2024 The Free Software Foundation, Inc.

Permission is granted to copy, distribute, and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of this license is included in the file COPYING.TXT

Last updated: December 18, 2023


Table of Contents

Top
Introduction
Examples
Templates (Field Guides)
Diagonal Wipes
Expanding Circle (Iris)
Clip Test
Circle Expands to Edges of Frame and Beyond
Circle Intersects With Frame
Polyrhythms
Marching_Octahedra
Marching_Octahedra_2

Back to top
Back to main page

Introduction

2023.04.24.
The examples on this page show how 3DLDF, MetaPost, TeX and GIMP may be used for various purposes when creating videos.

Normally, the examples fit within a frame of the dimensions 400mm × 225mm. These dimensions are in the proportion 16:9, which is a standard aspect ratio for video, and are as large as possible for fitting within the DIN A3 landscape format (420mm × 297mm), while leaving a reasonable margin at the sides (i.e., 1cm on each side).

Many of the examples consist of areas of a single color. This makes it possible to use them as masks or overlays: Pixels of a given color may be made transparent or converted to a different color using GIMP, ImageMagick or some other program or package. I plan to post examples of this technique to this webpage soon.

To include the image files generated by 3DLDF and MetaPost in the PDF files, they were output as Encapsulated PostScript (EPS) files. A consequence of this is that aliasing has probably been performed on the edges between areas of different colors. This causes some of the pixels to have different colors for the purpose of making a better visual impression. However, this is undesirable for the purpose of these images.

It is possible to remove the aliasing in GIMP by means of the "Posterize" command in the "Colors" menu. The ImageMagick command convert also has the option -antialias for removing pixel-aliasing, however, I have not yet tried this.

Another possibility is to have MetaPost output PNG files. In this case, making an assignment to the "internal string" variable outputformatoptions and setting the option antialias to none turns off antialiasing. I haven't yet tested what happens when outputting PNG files, converting them to EPS using convert and then including them in a (structured) PostScript or PDF file.

However, for further processing with GIMP, it makes more sense to produce PNG files in the first place. It is also possible to produce output using different file formats in a single run of MetaPost.


Back to top
Back to main page

Examples

2023.04.24.
To "flip" through the examples as though they were stacks of animation drawings, it's better to download them and view them in a PDF viewer or browser. Otherwise, the images are likely to "flicker" because of the greater latency before they can be displayed.

If the option "Fit Page" is chosen, then the "page forward"/"page back" and/or the "arrow up"/"arrow down" keys may be used to flip through the drawings.

Templates (Field Guides)

2023.04.24.
As of this date, the file video_templates.pdf contains three figures: 1. An empty frame. 2. The frame divided into quarters and 3. The frame divided into thirds.

Actually, the area of the frame isn't really divided into quarters or thirds. What is divided into quarters or thirds is each half of the x- and y-axes, respectively, and rectangles are drawn using the points of these divisions. So, in the "quarters" figure, the frame is divided into four unequal rectangles and in the "thirds" figure, it is divided into three.

In addition, the figures contain lines from the center to the end and mid-points of the sides and crosshairs near these points. The border of the frame and the crosshairs are drawn with solid lines and all of the others are dashed evenly.

3DLDF code:  video_templates.ldf
3DLDF macro file:  plainldf.lmc
TeX code: video_templates.txt
PDF file (DIN A3 landscape):  video_templates.pdf

Diagonal Wipes

3DLDF code:  diagonal_wipes.ldf
3DLDF macro file:  plainldf.lmc
TeX code: diagonal_wipes.txt
PDF file (DIN A3 landscape):  diagonal_wipes.pdf

Expanding Circle

Clip Test

2023.04.24.
This version supercedes the two below ("Expanding Circle" and "Circle Intersects with Frame"). It's not necessary to find the intersection points of the circle with the frame in order to fill in the area contained by the circle and contained by the frame. Instead, currentpicture may be clipped to the frame.

3DLDF code:  cliptest.ldf
3DLDF macro file:  plainldf.lmc
TeX code: cliptest.txt
PDF file (DIN A3 landscape):  cliptest.pdf

Circle Expands to Edges of Frame and Beyond

3DLDF code:  expanding_circle.ldf
3DLDF macro file:  plainldf.lmc
TeX code: expanding_circle.txt
PDF file (DIN A3 landscape):  expanding_circle.pdf

Circle Intersects With Frame

3DLDF code:  circle_isect.ldf
3DLDF macro file:  plainldf.lmc
TeX code: circle_isect.txt
PDF file (DIN A3 landscape):  circle_isect.pdf


Back to contents
Back to top
Back to main page

Polyrhythms

2023.04.24.
As of this date, the file polyrhythms.pdf contains an animation containing three objects that change shape independently of each other and each in its own rhythm.

The portion of the animation where movement takes place consists of exactly 900 frames. At 30 frames per second (fps), a standard frame rate for video, this corresponds to 30 seconds.

The blue circle b and the red circle r each start out with a radius of 0.5mm and the dark green square g starts out with a side length of 0.5mm. For each frame n where n=1, 2, 3...900, b is scaled by the value 1+(n × .16667). It therefore grows continuously.

r is scaled by 1+n, but only until 1+n reaches 50, when it starts to shrink at the same rate, until it reaches the value 10, when it starts to grow again.

Finally, g grows at a rate of 1+.333n until that value reaches 60, when it shrinks at the same rate until it reaches the value 2, when it starts to grow again.

By changing the way the figures are scaled, it would be possible to add "acceleration" and "deceleration" to the growing and shrinking.

3DLDF code:  polyrhythms.ldf
3DLDF macro file:  plainldf.lmc
TeX code: polyrhythms.txt
PDF file (DIN A3 landscape):  polyrhythms.pdf


Back to contents
Back to top
Back to main page

Marching Octahedra

Marching Octahedra Nr. 2

2023.12.18.
Please note that the PDF file is in DIN A2 landscape format (594 by 420mm), so it would have to be scaled down to be printed!

3DLDF code:  marching_octahedra_2.ldf
3DLDF macro file:  plainldf.lmc
C++ code for calling ImageMagick commands: process_files_marching_octahedra_2.cxx
TeX code for the title page: marching_octahedra_2_title.txt
TeX code: marching_octahedra_2.txt
Compressed PDF file (DIN A2 landscape):  marching_octahedra_2.pdf.gz


Back to contents
Back to top
Back to main page