ambrosiogabe / MathAnimation
- пятница, 6 января 2023 г. в 00:36:50
A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
This is a tool I use to create animations for my videos on my YouTube channel. You can see an example of a video created using this tool here. My goal is to have nearly identical animations to those produced by Manim, except in realtime with a GUI+audio preview to enhance the editing process.
This is a small GIF showcasing some of the capabilities of this tool:
First clone the repository and the submodules by running:
git clone --recursive https://github.com/ambrosiogabe/MathAnimation
These instructions only need to be followed the first time you ever compile this library.
In order to compile this manually, you need to build static binaries for FFmpeg so they can be copied to the final build and statically linked into the application.
I'm only writing instructions for Windows and MSVC. For information on compiling ffmpeg in a different environment, please see the ffmpeg documentation for further details and make the appropriate changes.
Unfortunately, ffmpeg is a particularly wild beast, so compiling is non-trivial.
(The following instructions are modified from ffmpeg documentation)
First, make sure to have these tools installed:
Next, follow these steps:
nasm.exe
in your PATH
.msys_shell.bat
from the Visual Studio or Intel Compiler command prompt. To do this:
x86_x64 Cross Tools Command Prompt for VS 2022
in your windows search bar.
cd C:\tools\msys64
msys2_shell.cmd -use-full-path
to launch msys2.cl
works. Running cl
should print something starting with: Microsoft (R) C/C++...
NASM
is available. Running nasm -v
should print the version.pacman -S diffutils
pacman -S make
# NOTE This will take quite some time to compile
# To compile it faster you can use `make -j{core count}` instead of `make` where
# core count is 2 cores less than the number of cores available on your machine
pushd ./Animations/vendor/ffmpeg
./configure \
--toolchain=msvc \
--prefix=./build \
--disable-doc \
--arch=x86_64 \
--disable-x86asm
make
make install
# Rename the files to .lib extension to make premake happy
mv ./build/lib/libavcodec.a ./build/lib/libavcodec.lib
mv ./build/lib/libavdevice.a ./build/lib/libavdevice.lib
mv ./build/lib/libavfilter.a ./build/lib/libavfilter.lib
mv ./build/lib/libavformat.a ./build/lib/libavformat.lib
mv ./build/lib/libavutil.a ./build/lib/libavutil.lib
mv ./build/lib/libswresample.a ./build/lib/libswresample.lib
mv ./build/lib/libswscale.a ./build/lib/libswscale.lib
popd
build
in the directory ./Animations/vendor/ffmpeg/build
. Inside this directory you should see several files with a .lib
extension, these are the ffmpeg binaries.
NOTE: Make sure that you have completed the first time setup instructions if this is your first time compiling this project. Click the dropdown above to get the full instructions.
NOTE: CMake is required to build this. Make sure you have CMake 3.15 or newer installed.
Run the following commands:
mkdir build
pushd build
cmake ..
popd
Then open the project build/MathAnimationsPrj.sln
or compile it from the command line using the MSVC developer's prompt.
Project Management:
Scene Manager
tab.Asset Manager
tab.Console Output:
Asset Manager
will dump any errors hereAnimation Editor View:
Animation View:
Export Video:
Timeline (can be found in the Timeline
tab):
Undo-All
button to the right of the zoom barDelete
on your keyboardAnimations (can be found in the Animations
tab):
Scene Tab:
Delete
on your keyboard to delete itAnimation Objects (can be found in the Scene
tab):
Animation Object Inspector:
Copy
symbol to the right of it, clicking that will apply the change to all childrenAnimation Inspector:
Timeline
to open its properties hereAnim Objects
dropdown allows you to add animation objects to this animation. Just drag the animation object from your Scene
panel into the drop area after pressing Add Anim Object
Synchronous
or Lagged
App Metrics:
Editor Settings:
Please see the attached EULA for information on what is and isn't allowed. I'm not opposed to people forking this library and continuing solo development on a new project based off of this source code, however reach out through Github issues or other communication methods with me before doing so. This library is free for you to compile and modify for your own personal use, but it is not free for you to distribute any binary copies (paid or free). If you have any questions, please reach out to me through Github issues, Discord, or any other communication method you find appropriate.