ambrosiogabe / mathanimation Goto Github PK
View Code? Open in Web Editor NEWA simple C++/OpenGL application to create quick and dirty mathematically accurate animations
A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
Currently you can't specify the following properties for Image Objects:
Implement these.
Additionally, when you load a texture right now it's possible for the stb_image
to fail. There's a TODO in the code to propagate the errors to the end user. Implement this and then display a friendly error message to the user if the image fails to decode for whatever reason.
And finally, the texture cache only caches according to filepath. This can be confusing because what if you want to load the same image twice where one is sampled with GL_LINEAR
and the other is sampled with GL_NEAREST
? Well, the texture cache will just reuse whichever parameter was loaded first and won't change anything. Eww...
So, fix this up by adding additional features to cache invalidation. An image should be cached by at least the following:
and possibly more options if I think of them.
Use some shader magic to give the write-in animations a more hand-written feel by giving the part that's being drawn in a rough texture.
Blender has a plugin that will write some text in the lower-left corner of the viewport to indicate which "actions" were just performed. For example, if you press 'G' it will show something like:
G - Move Mode
That slowly fades out. This is useful for tracking what a user is doing while watching, and it's also useful for a user who has no idea why a keypress randomly changed something. It would be nice to have this.
The text should show up for any action that occurs (not sure what constitutes an action: key combos only? Or extra stuff too?). If multiple actions are pressed in rapid succession the text should shift up and the new action should fade in below it. The oldest text should fade out after like 1.5-2 seconds, whatever feels right.
Maybe there should be a cap on the number of actions visible at any one time as well. So maybe like 5 actions at once max, or whatever looks the best.
Use the theme support from code highlighting to also style the editor with different color schemes
Some things are sorely needed in the scripting, here's a list:
As you wrote in your Video , if there are some Latex support Librarys:
Add support for plain old images. It should have a dropdown to control whether it's sampled using linear or nearest sampling (or maybe others at some point too).
You should be able to format text inline with custom colors etc. Something like:
This is some text with <color = "blue">BLUE</color> text!!
This is some text with <i>ITALIC</i> text!
And this is some text with <bold><italic><color="yellow">multiple styles</color></italic></bold> on the text!!
Note that the formatting should support HTML style groups with the following:
# TODO: Should this be supported??
Additional notes:
For group formatting (these things <></>):
INVALID: No matching \</bold\>
OK: Close order matches open order bold -> italic <-> italic <- bold
NOT OK: Close order is unmatched bold -> italic <-> bold <- italic
Any additional formatting rules will be written down here for documentation purposes. They will also be documented as part of this repositories documentation as they get added.
This isn't technically a bug. Its a readme related issue. Please add to the first-time compile these fixes.
pacman -S diffutils
. It is complaining that it does not find a program called "cmp" which is a program that comes with diffutilspacman -S make
to install make that is not default.msbuild ...
wont work.Hope you update these in the readme about installation for first time
Describe the bug
Dragging some things crash the program. "No tree elements, impossible to drag"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Maybe it should just say you cant drag it instead of crashing
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Add an onGizmo method to scriptable objects for custom gizmos to be drawn
Often times you need to add a group of animations that together. It's annoying placing all these on separate timeline tracks and then carefully aligning them etc. Maybe it's possible to add an AnimationGroup thing similar to Manim. Where you can add several different animations to this group then you can synchronize them or play them lagged.
The difficult part for this is how should the UI look? Should you be able to double click into an animation group on the timeline and then edit each animation individually in a sub-timeline kind of thing? Or should the animation inspector just show a bunch of animations and allow you to click them and then open a sub-menu?
I like the idea of the sub-timeline opening up, kind of like how code editor open the context of the file you're looking at a function inline. This sounds plausible but will require a lot of effort to add feature support on the timeline for this. Might be worth it though...
Right now creating animations and tracks is pretty annoying. Some ideas that may help streamline this process are:
All the features look amazing, but I have to say that the GUI looks not the greatest.
Some parts the GUI don't look exactly that bad, like the Timeline, but other parts like the title of sections, look awkward. Especially with the scroll boxes.
Add a mechanism to fallback to older OpenGL calls if the client machine doesn't support the latest version. Fallback version will be OpenGL 3.1
and no earlier.
If you create a script like the following:
local MathAnim = require("math-anim")
function quadTo(p0: Vec2, p1: Vec2, p2: Vec2, t: number): Vec2
local x = (1.0 - t) * ((1.0 - t) * p0.x + t * p1.x) + t * ((1.0 - t) * p1.x + t * p2.x)
local y = (1.0 - t) * ((1.0 - t) * -p0.y + t * -p1.y) + t * ((1.0 - t) * -p1.y + t * -p2.y)
return {x = x, y = y}
end
function vecAdd(a: Vec2, b: Vec2): Vec2
return {
x = a.x + b.x,
y = a.y + b.y
}
end
function vecSub(a: Vec2, b: Vec2): Vec2
return {
x = a.x - b.x,
y = a.y - b.y
}
end
-- This is automatically called when the object is generated
function generate(parent: MathAnim.AnimObject)
local lineTri1: MathAnim.AnimObject = MathAnim.createAnimObject(parent)
lineTri1:setName("Tri1")
lineTri1:setPositionVec({x = 0, y = 0, z = 0})
lineTri1:setColor({r = 120, g = 207, b = 114, a = 255})
local p0 = {x = -2, y = 0}
local p1 = {x = 0, y = 2}
local p2 = {x = 2, y = 0}
local p3 = {x = -2.1, y = 0.1}
local p4 = {x = 0, y = 2.2}
local p5 = {x = 2.1, y = 0.1}
local numSegments = 40
lineTri1.svgObject:beginPath(quadTo(p0, p1, p2, 0.0))
for i=1, numSegments do
local t = i / numSegments;
lineTri1.svgObject:lineTo(quadTo(p0, p1, p2, t))
end
lineTri1.svgObject:lineTo(quadTo(p3, p4, p5, 1.0))
for i=numSegments - 1, 0, -1 do
local t = i / numSegments
lineTri1.svgObject:lineTo(quadTo(p3, p4, p5, t))
end
lineTri1.svgObject:closePath(true)
local colors: {[number]: Vec4} = { }
colors[1] = {r = 0, g = 0, b = 0, a = 255}
colors[2] = {r = 255, g = 0, b = 0, a = 255}
colors[3] = {r = 0, g = 255, b = 0, a = 255}
colors[4] = {r = 0, g = 0, b = 255, a = 255}
local newNumOffset = 7
local tOffset = 1 / newNumOffset
for i = 1, newNumOffset do
local quad: MathAnim.AnimObject = MathAnim.createAnimObject(parent)
local t = i / newNumOffset
quad:setName("Quad_"..i)
quad:setColor(colors[math.fmod(i, 4) + 1])
quad:setPositionVec({x = 0, y = -1, z = 0})
local v0 = quadTo(p0, p1, p2, t - tOffset)
local v1 = quadTo(p0, p1, p2, t)
local v2 = quadTo(p3, p4, p5, t)
local v3 = quadTo(p3, p4, p5, t - tOffset)
local xCentroid1 = (v0.x + v1.x + v2.x) / 3
local xCentroid2 = (v1.x + v2.x + v3.x) / 3
local xPos = (xCentroid1 + xCentroid2) / 2
local yCentroid1 = (v0.y + v1.y + v2.y) / 3
local yCentroid2 = (v1.y + v2.y + v3.y) / 3
local yPos = (yCentroid1 + yCentroid2) / 2
local pos: Vec2 = {x = xPos, y = yPos}
v0 = vecAdd(v0, pos)
v1 = vecAdd(v1, pos)
v2 = vecAdd(v2, pos)
v3 = vecAdd(v3, pos)
quad.svgObject:beginPath(v0)
quad.svgObject:lineTo(v1)
quad.svgObject:lineTo(v2)
quad.svgObject:lineTo(v3)
quad.svgObject:closePath(true)
end
end
it breaks very bad.
When I run cmake.. i get this error
CMake Error at CMakeLists.txt:3 (project):
Running
'nmake' '-?'
failed with:
Het systeem kan het opgegeven bestand niet vinden
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/Senne/Desktop/mathanimator/MathAnimation/build/CMakeFiles/CMakeOutput.log".
It would be nice to use the program on mac
Add a file picker to the export video panel instead of exporting directly to the current directory
The plumbing is all there, I just have to add an input box for when the user is saving the current layout as a new layout. This should just save the layout to a file of the same name located in the location listed in EditorLayout
for custom layouts.
Add more hotkey support. Preferably have some Blender style hot keys for moving objects etc, and show some Blender style guidelines while moving objects etc.
Also fix gizmos.
The animation inspector and animation object inspector should probably be combined into one inspector.
Also, the inspectors should have dropdowns for different components (like a transform component, text component, move to component, etc) kind of like unity. These should be collapsible, but don't worry about reordering them or saving the collapsed state or anything right now.
Describe the bug
A clear and concise description of what the bug is.
Compiling error: 'Error copying file "C:/Users/Andrew/Desktop/MathAnimation/imgui.ini" to "C:/Users/Andrew/Desktop/MathAnimation/build/bin/Release"'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
i expect it to be able to copy a file
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Fix the deltas in the scene optimization. Right now skipping around the timeline recalculates everything from frame 0 which starts to lag stuff. Add back in the optimization where it can skip using a delta and only apply the necessary changes.
This is just to track progress on Linux support. Once support and README instructions get added for building on Linux, this issue can be resolved.
I want to be able to write custom scripts that create custom animations and can modify objects in the scene etc.
Right now there is one AnimObject that encompasses several different types of objects, and one Animation structure which encompasses several different kinds of animations. Also, the data is stored in unordered_maps which means iterating through the data is extremely slow.
Switch to a flat data layout, like an ECS, and remove the hierarchical structure in favor of a component based structure. This should speed things up with larger scenes and it should also make the code much more manageable.
Clicking on an object makes all the parents/children disappear which is very annoying while trying to edit it
Come up with a method for undo/redo. It should undo stuff in a way that makes sense to. For example:
Etc. Redo should likewise redo things in a sane fashion :)
Make it easier for contributors. Add some continuous integration tools like:
This Feature Request can be broken up into smaller Feature Requests as needed.
Gizmos don't scale
I doubt it'll happen, but if you could SOMEHOW make this possible to use on the web, you would be an absolute giga-chad. All I have is a Chromebook, which is wimpy and cannot handle such power.
Switch from binary save files to JSON save files so that data corruption is much less likely and can be fixed easily if it does happen.
Enable ffmpeg optimizations for rendering.
Also, triple buffer the rendered frames to avoid bottlenecks from GPU/CPU wait cycles.
The bounding box information for squares, arrows, and circles are off by a half size.
Where do I run this?:
REM NOTE This will take quite some time to compile REM To compile it faster you can use
make -j{core count}instead of
make` where
REM 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
REM 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`
in msys msys2 or in the vs cmd or where. What file. How. Thanks
The dragging breaks when you get a big number of objects.
Everything 3D is broken right now. Please fix it and make it work well with everything else.
Add animations that allow the active camera to zoom in and out.
Add a default layout for users that open the editor for the first time. Ideally, it should scale somewhat depending on the screen size and be adaptable so you can save different layouts for future use.
The active object should have a light outline surrounding it. It doesn't work right now because I never found a good solution for it. Research outlining objects and see if you can come up with a good solution. Here's some starting points:
Allow objects to snap to center points and edges etc of other objects while moving them with gizmos in the scene
The LRU cache has never worked right and is currently very broken. Fix it.
Replacement transform animations generate way too many intermediate SVGs that need to be cached. Instead, only create SVG caches for every 6-10 frames of the animation then interpolate between the sprites. Do some testing to see where a good balance lies for this, and then make sure while exporting the video all animations get rendered correctly everytime.
Creating a new scene should automatically contain:
When dragging a object in the scene hierarchy panel, you can't reparent it by dropping it on another object.
Add bounding boxes to AnimObjects so that the Circumscribe animation can function appropriately and other functions can appropriately function. Also add parent + children bounding boxes that contain the bounding boxes for all the children + the current object which is the parent.
Make sure that the cached SVGs are only as big as they need to be. So if the biggest SVG path that gets rendered to the final output is only 50px X 50px, make sure the cached SVG isn't any bigger than that.
While editing, the SVGs should be at 1/3, 1/2, or 2/3 the size depending on the viewport fidelity. Then during export it should be 1:1 where possible. If making the SVG 1:1 with the rendered size would result in too big of a texture, then clamp it at a reasonable cutoff value.
For example, if the final output is supposed to 8300px wide, that's ridiculous and I won't support that fully since GPUs have practical limits and the exported video is only 4K max right now. So instead of making the final output 8300px, clamp it to something like 2000px max.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.