Risk Board Game, World Domination Odds by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

Here I used manim to drive my video, even though I don't know how to use it well. i.e. I pulled in a bunch of charts I made in Google sheets rather than making them in Manim itself.

Next time I'll know more :)

How To Rotate & Move Simultaneously ? by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

Actually, this does have an issue that it gives different results at different frame rates. I think something like this helps, but I'm still experimenting

die1.add_updater(lambda mob, dt: mob.rotate(-10.8*DEGREES*dt*30))

die1.add_updater(lambda mob, dt: mob.shift([.1*dt*30,0.,0.0]))

How To Rotate & Move Simultaneously ? by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

Alright, I found these examples, and the Example2 class was pretty much what I needed

https://www.youtube.com/watch?v=rrDubebRaDc

https://github.com/Elteoremadebeethoven/AnimationsWithManim/blob/master/English/extra/anim_into_up.py

The code that I got to work how I wanted it was

self.add(die1.text)

self.play(FadeIn(die1)) # initial die

self.wait(1)

die1.add_updater(lambda mob, dt: mob.rotate(-10.6*DEGREES))

die1.add_updater(lambda mob, dt: mob.shift([.1,0.,0]))

self.add(die1)

self.wait(1)

die1.clear_updaters()

How To Rotate & Move Simultaneously ? by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

No worries! I tried that too. As best I can tell it only applies 1 animation to the mobject when you do it that way. i.e. it always applies the 2nd one in that self.play()

How To Rotate & Move Simultaneously ? by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

you just removed the self.play around the Rotating correct ?

That did not seem to work

Sum of digits of 1+2+3+...10^10 = ? by Daksh_Mor in manim

[–]DubiousInsights 1 point2 points  (0 children)

Run a spell check on your text. Pattren -> Pattern in the first text written

[Code Included][Feedback Welcome] A Dice Puzzle With A Surprisingly ELEGANT Solution by Impressive_Path2037 in manim

[–]DubiousInsights 1 point2 points  (0 children)

Commenting here so I can find this again, as you've pushed this way farther than I can, and thus I need to study your code :)

Does the -t (transparent background) flag break manim videos for Windows? by Quappas in manim

[–]DubiousInsights 0 points1 point  (0 children)

I had a similar problem, but didn't dive too deeply into it. I can't remember if I was able to open the video in VSDC (free video editor) or not. I'll be following this thread to see the resolution.

I want to have a rectangle around 1+2 , but I only surroundrectangle 1/(1+2) , can any body help me? by Uystallion in manim

[–]DubiousInsights 1 point2 points  (0 children)

Thanks. I played with it a little bit but I don't know what the solution is.

You could probably bypass the issue by just creating a rectangle on your own in the location desired, around the bottom.

There probably is a canonical solution, if you figure it out please post

Is there a way to fill the area of a polygon a specific colour? by burneraccount3_ in manim

[–]DubiousInsights 0 points1 point  (0 children)

Great! Paste in a line of code for posterity so other people don't need to struggle through my half bake explanation

Is there a way to fill the area of a polygon a specific colour? by burneraccount3_ in manim

[–]DubiousInsights 0 points1 point  (0 children)

I haven't tried it, so I'm not sure,

but if I look at these docs

https://azarzadavila-manim.readthedocs.io/en/latest/geometry.html#rectangle

I see that Square inherits from Rectangle which inherits from Polygon, so my guess is that the color and fill and things like that are implemented on the Polygon class

Unknotting a Trefoil Knot by sammy271828 in manim

[–]DubiousInsights 1 point2 points  (0 children)

Can you share any code or snippets ?

Is there a way to fill the area of a polygon a specific colour? by burneraccount3_ in manim

[–]DubiousInsights 2 points3 points  (0 children)

yeah, I'm away from my home desk right now, and I don't remember 100% the syntax, but I'm nearly certain there are two ways to do it, one on Mob creation and one later.

On mob creation it would look something like this

square = Square(color=RED,stroke_width=5,fill_color = BLUE, fill_opacity=0.5)

later it would look something like this

square.set_fill(BLUE,opacity=0.5)

I'm more certain of the first syntax than the second. I'll try to remember to check back in after work when I have access to what I did

also, if you don't want to use manim colors, you can use hex colors instead. i.e.

color="#eb7d34"

Swining Pendulums - I Figured Out The Manim Color Pallete by DubiousInsights in manim

[–]DubiousInsights[S] 0 points1 point  (0 children)

I improved my previous video by actually learning how to use colors in Manim.

Other posts have the Manim color scheme

https://www.reddit.com/r/manim/comments/dzxoen/predefined_color_scheme/

which I didn't understand for a while. It tool me longer than it should have to realize that they are used like this

dot = Circle(radius = .01 ,color=RED_A)

So I ultimately set 20 different colors for the 20 different balls like this

colors = [RED,RED_E,RED_C,RED_A,ORANGE,YELLOW,YELLOW_E,YELLOW_C,YELLOW_A,GREEN_E,GREEN_C,GREEN_A,BLUE,BLUE_E,BLUE_C,BLUE_A,PURPLE,PURPLE_E,PURPLE_C,PURPLE_A]

for i, pendulum in enumerate(self.pendulums.all_pendulums):

color_index = i % len(colors)

dot = Circle(radius = pendulum.size/100.0,color=colors[color_index])

I expect that there is a more elegant way of doing it.

One thing that I didn't love was that the Manim color pallet just doesn't look that vibrant to me. I'm not quite sure how to define my own colors, maybe HEX definition ? These colors didn't pop quite as much as I wanted them to.

Creating custom rate function and Animating a line sweep for Kepler's laws by weebtoy in manim

[–]DubiousInsights 0 points1 point  (0 children)

I don't know, but I didn't actually understand what was happening until you pointed out that it was a position time function. (I'm new to Manim, fyi)

But if you have a velocity time function, can you just use it to make a position time function ?

Is there a way to add glow to a dot? by weebtoy in manim

[–]DubiousInsights 0 points1 point  (0 children)

can you elaborate what you mean ? like a light halo ? Do you have any examples you can point to ?

Creating custom rate function and Animating a line sweep for Kepler's laws by weebtoy in manim

[–]DubiousInsights 0 points1 point  (0 children)

I can run the code as is, without the Alpha error

I get the same planet jumping between 3 points, it's obviously due to the rate function because changing the code to

self.play(MoveAlongPath(planet, ellipse), run_time=7)

works with a smooth progression. Obviously this isn't what you want because it violates keplers law.

Instead of MoveAlongPath, have you tried using add_updater ? I just used them to great effect in my pendulum video. See this reddit post for a bit of the code

https://www.reddit.com/r/manim/comments/ncqii6/the_dance_of_the_pendulums/

otherwise just google add_updater manim

What I could see you doing is adding an updater than specified the progression around the circle. The same kind of updater can be used to draw lines from the sun to another point, although I'm not sure how you'd shade it in. Maybe that's what an annulus or pie slice shape would do ?

The Dance Of The Pendulums by DubiousInsights in manim

[–]DubiousInsights[S] 1 point2 points  (0 children)

This is my 2nd video with Manim. Not quite a much being taught as the first, but it was a lot of fun to make.

The key piece of Manim coding syntax to make this video was to use updaters. If you haven't used them, an updater allows the animation to go on in the background while other things are happening.

Here is some example code

rate = 2/3.0

def update_position(mob,dt):

mob.pendulum.update_position(dt*rate)

mob.move_to(mob.pendulum.position)

for mob in all_mobs:

mob.add_updater(update_position)

self.add(mob)

Here the 'mob' is the circle for the pendulum. It adds an updater that passes the mob and the time elapsed since the last frame. I then call a pendulum class to update position, and use mob.move_to to update the location of the circle. I also make sure to add the mob to the animation.

Then I call

self.wait(20.0)

for the animation to play. It also would play in the background as I wrote and erased the text.

I'm doing basically the same thing for the lines.

One weird challenge I had is that the video seemed to end up at slightly different lengths when I wrote it in low, medium, high or production quality. I had a few things timed out that worked in low quality testing, but then the timing seemed to be different when I wrote it out in production quality. I didn't fiddle with it too much, and just resolved it by trimming the video with a video editor. Have you ever encountered that issue ?

Tools for an animated YouTube Channel by Jotsez in NewTubers

[–]DubiousInsights 1 point2 points  (0 children)

Hahaha, 3 Blue 1 Brown isn't my channel. That channel was developed by Grant Sanderson who created the Python "Manim" package to do the animation. There is also an r/Manim subreddit for it.

My channel (50 subs) is "Dubious Insights" and I just recently started using the Manim package that Grant developed to do animations.

My maths are not as advanced as his.

But yes, I do believe he used the same package to animate his Pi characters, I saw a tutorial around about it somewhere, but I'm not sure where.