My Own 3b1b Animation Engine but in C

Ғылым және технология

Streamed Live on Twitch: / tsoding
Panim Playlist: • Panim
References:
- 3Blue1Brown Channel: / 3blue1brown
- Tsoding - Musializer - github.com/tsoding/musializer
- Tsoding - Tula - github.com/tsoding/tula
- Easings - easings.net/
Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
- Pay for my VPS: zap-hosting.com/en/shop/donat...

Пікірлер: 100

  • @BboyKeny
    @BboyKenyАй бұрын

    "Remember the code is more scared of you than you are scared of the code" - Zozin 2024

  • @no_name4796

    @no_name4796

    16 күн бұрын

    I mean, the code doesn't crash you, you cŕash the code...

  • @Lewdovico
    @LewdovicoАй бұрын

    Looks like we're alive.

  • @TheMelopeus

    @TheMelopeus

    Ай бұрын

    He is alive and well, active on twitch and discord :D

  • @Daniikk1012
    @Daniikk1012Ай бұрын

    I think the main reason people love Lua is because of how incredibly simple, yet powerful it is (Same reason people like C, but it's a scripting language, so in a different way). The only structural data type in it is a table. Want arrays? Use integers as keys. Want an object? Use field names. Want a dictionary? Use whatever you want as the key. Want to access something that doesn't exist? It's nil. Want to delete something? Set it to nil. Applies to both fields in tables and variables. The syntax is minimal. No need for semicolons OR newlines, because it is always possible to infer where statement separation occurs. There are only 21 keywords, which is mostly control flow and primitive values. Want more power? That's what metatables are for. Use them to add operator overloading to your tables. Or use them to implement inheritance. The compiler/interpreter itself is also deliberately simple. It is a single pass compiler, written in pure ANSI C (Except for dynamic linking, but for embedding it is an understandable compromise), very fast and small (One of the fastest scripting languages), because it was designed to be embeddable.

  • @TheDolphiner

    @TheDolphiner

    Ай бұрын

    Reading the lua manual really gives the feeling of "we want the most power with the fewest features." It doesn't have traits I look for in a "real" language, but it's inspiring as a different perspective designed with a different use case than the mindset I usually work with.

  • @angryapplebombs914

    @angryapplebombs914

    Ай бұрын

    This is actually one of the best comments I’ve read describing why I find Lua so enjoyable thank you for this. I might steal it later

  • @JH-pe3ro

    @JH-pe3ro

    Ай бұрын

    I switched over from Lua to Janet recently because it brings the mindset of Lua to a Lisp syntax, without the compromises of Fennel or the baggage of CL/Scheme systems. And it's more fleshed out as a standalone scripting system, which ended up being "bolted on" to Lua with Luarocks, and I've never been happy with how that worked. It takes a little while to get comfortable with the idioms specific to Janet, but I'm finding it cozy enough. Edit: Also, if we are after minimalism, Forth is a decent scripting environment for gluing together chunks of assembly, and probably enough for this usecase.

  • @jeremyjurksztowicz6278

    @jeremyjurksztowicz6278

    Ай бұрын

    Metatables and coroutines elevates Lua to S-tier power. Also small and fast enough to run on a GameBoy Advance. Love Lua.

  • @no_name4796

    @no_name4796

    16 күн бұрын

    Honestly i descovered lua writing my neovim config, and yeah it's a very interesting language. It's nice that it's not polluted with 69 ways to do the same thing (cough cough c++ cough cough)

  • @user-lc8gw8vl7h
    @user-lc8gw8vl7hАй бұрын

    that "i can't even spell 'world' anymore, i haven't programmed in C for a while" caught me off guard

  • @adampaul7905
    @adampaul7905Ай бұрын

    I want a full song from "Can you Rust doooo thaaaat ? i don't think soooo"

  • @HuntingKingYT
    @HuntingKingYTАй бұрын

    "Remember - code is afraid of you more than you are afraid of code" - I really like this quote, until they start using it on dogs.

  • @toddkfisher
    @toddkfisherАй бұрын

    The commentary on Stack Overflow alone makes this worth watching.

  • @rubenvis6568

    @rubenvis6568

    Ай бұрын

    Starting at about 1:52:10 :-)

  • @SaidMetiche-qy9hb
    @SaidMetiche-qy9hbАй бұрын

    Tosding the gordon ramsy of C programming 🤣🤣

  • @stephanbranczyk8306
    @stephanbranczyk8306Ай бұрын

    Honestly, AI is not much better. Google's AI would refuse to give information on C/C++ functions to minors because the functions were tagged "unsafe"

  • @SiiKiiN
    @SiiKiiNАй бұрын

    I'm excited to see what primitives you decide to use. I know that the what makes manim good is the choice of primitives, I'm assuming the same needs to happen with this library considering its a programming viz and not just a viz.

  • @skilz8098
    @skilz80986 күн бұрын

    You can do all of this in Assembly if you know what you are doing. C/C++ just makes assembly much easier and more streamlined as they automate a bunch of repetitive tasks for you behind the scenes. You don't have to setup and tear down all the registers for the stack frame, you don't have to manage the stack pointer for every routine call, you don't have to query or access the hardware or interrupts directly, you don't have to manage the memory at the hardware level and worry about v-table entries, and so on. You don't have to worry about which register your return value is in, checking the flags for the conditions of all of your operations, the branch predictor, etc. Assembly is architect independent, machine specific and isn't really portable. Yet you can still do all of this in Assembly if you know what you are doing. It's not about this language or that, it's about your understanding of the hardware and how the software operates it. At the end of the day, it's a skill issue based on your level of understanding and knowledge of the system you are interfacing with.

  • @kaelanm-s3919

    @kaelanm-s3919

    5 күн бұрын

    Bro, making a graphics library by raw dogging assembly???? Please stop, you're giving me new nightmares to wake up to

  • @chillydill4703
    @chillydill4703Ай бұрын

    I like where this is going, tsoding!

  • @alexanderkovalev391
    @alexanderkovalev391Ай бұрын

    you're actually reinvented erlang's hot code reload approach with your plugin system. take a look at those ideas, it is really cool when the entire system upgrades with no restart

  • @SaidMetiche-qy9hb
    @SaidMetiche-qy9hbАй бұрын

    17:20 Skia is a giant Google bloatware for drawing shapes that's like 600megs of source

  • @curious5972
    @curious5972Ай бұрын

    I made my own engine almost 2 years ago for my grad project. I used ffmpeg and nodejs child process and my own graphics library written in JS. Which gives me a massive success in grad result. Its even 3 times faster than manim ❤

  • @ardnys35

    @ardnys35

    Ай бұрын

    hi, i am looking for inspiration for my grad project and this graphic stuff is really interesting. how difficult was it and did you do it by yourself or with a group? it's hard to find a topic interesting but also not too difficult to scare people away, because we have to do it with a group.

  • @ratchet1freak
    @ratchet1freakАй бұрын

    For programming the animation itself maybe an immediate mode style api would be nice. Instead of having to build an array of keyframes. Which are going to be a pain to change on a hot reload. If you don't mind borrowing from sebastian lague's animation setup. That is you have a function that gets called every frame and it then does things like float t = interval(a, 5); which returns a value from 0 to 1 depending on where in the animation you are. Then the next time you call interval(a, 3) the effective interval starts after the previous one finished. And it uses the t to render an animation. To facilitate this you would need a float animTime; and a float currentTime; in Animation where animTime gets updated based on the input into interval() and currentTime is the time you are visualizing. So the return value becomes return remapAndClamp(currentTime, animTime, animTime + period, 0, 1) You can apply ease-in and out on the returned t if needed.

  • @_orangutan
    @_orangutanАй бұрын

    I think Tsoding programs in a Hyperbolic Time Chamber.

  • @gg-bt4sp
    @gg-bt4spАй бұрын

    Hi, Panim playlist link broken Have a nice day

  • @TsodingDaily

    @TsodingDaily

    Ай бұрын

    Thank you! Fixed!

  • @minirop
    @minirop18 күн бұрын

    the *worst* part of function pointer declaration is that it was done "on purpose". there is a special case in the parser to handle that ugly syntax IIRC.

  • @zeusdeux
    @zeusdeuxАй бұрын

    New tsoding vid, let’s goooooo!!

  • @hieudoan4929
    @hieudoan4929Ай бұрын

    Lol perfect illustration of SO answer

  • @blackhaze3856
    @blackhaze3856Ай бұрын

    Is 3b1b parent of R2D2?

  • @Shywizz

    @Shywizz

    Ай бұрын

    Its 3*blue*1*brown* another channel that does explanatory math videos

  • @angelcaru

    @angelcaru

    Ай бұрын

    @@Shywizz www.wikipedia.org/wiki/Joke

  • @oserodal2702

    @oserodal2702

    Ай бұрын

    ​@@angelcarubetter response than wooosh

  • @howdoiexitvim-sg2xl

    @howdoiexitvim-sg2xl

    Ай бұрын

    ​@@oserodal2702the most amazing thing is youtube not obliterating the comment containing a link

  • @programist2.091

    @programist2.091

    Ай бұрын

    And a nephew of 2b2t

  • @nashiora
    @nashioraАй бұрын

    If I have to use a dynamic language, for any number of reasons, I'd want it to be Lua. I love it for the semantics, definitely not the syntax haha. Otherwise, yes I'd also prefer statically typed compiled languages.

  • @apenaswellignton
    @apenaswelligntonАй бұрын

    Pog

  • @BolasDear
    @BolasDearАй бұрын

    what are programming socks , i had not found them in whole market.

  • @shoofle
    @shoofleАй бұрын

    the captions seem to be a chat playback for some reason!

  • @sudoupdate
    @sudoupdateАй бұрын

    Itzzzzz Tshooooding suiiiiiiiiii

  • @AlmogD
    @AlmogDАй бұрын

    LOVE YOUR VIDEOS The Panim Playlist link is not working :(

  • @hamed9327
    @hamed9327Ай бұрын

    the pascal case function names are so clear, what is this font?

  • @imgoingtojuneyou

    @imgoingtojuneyou

    Ай бұрын

    Iosevka

  • @hubstrangers3450
    @hubstrangers3450Ай бұрын

    Thank you....

  • @aniketbisht2823
    @aniketbisht2823Ай бұрын

    2:02:53 Why do you use memset/memcpy for struct instead of assignment? Is this a C thing? I think C does support struct assignment. As a C++ programmer, this is absolutely bizarre.

  • @mihailazar2487
    @mihailazar2487Ай бұрын

    As the prophecy fortold

  • @anon_y_mousse
    @anon_y_mousseАй бұрын

    Maybe RIIC should become the catch phrase. I think I should start that cult.

  • @user-gi8oc4dr1c
    @user-gi8oc4dr1cАй бұрын

    Best animation for loot boxes in game 😂

  • @suvetar
    @suvetarАй бұрын

    Skia is a graphics library from Google, it has a lot of handy bindings ... in Csharp for example ... raylib is way cooler though 🙂

  • @kerowagdy9417
    @kerowagdy9417Ай бұрын

    How is Twitch Chat caption even possible? 🤔 I haven't uploaded a single video on yt so it might be easy. Is it that you can export stream chat as transcript ?

  • @yjlom

    @yjlom

    Ай бұрын

    you can read the chat with the API, so it should just be a matter of storing the comments with their timestamps and then converting that to a transcript track

  • @kerowagdy9417

    @kerowagdy9417

    Ай бұрын

    @@yjlom Yeah that makes sense

  • @lordeji655
    @lordeji655Ай бұрын

    28:53 I don't know why people ignore the gcc "-fanalyzer" option which gives A LOT more warning and would, for example here, clearly give a warning for a segfault.

  • @multicoloredwiz

    @multicoloredwiz

    Ай бұрын

    It's annoying n slow. Surprisingly cl /analyze is pretty good!

  • @lordeji655

    @lordeji655

    Ай бұрын

    @@multicoloredwiz annoying ? To have warnings that help you not crash your program ? And obviously it's slower. It's a tradeoff as always in programming. The most important thing is that you can choose between safety and speed which is the power of C (while rust fans will brag about the safety and then compile for 10min).

  • @multicoloredwiz

    @multicoloredwiz

    Ай бұрын

    @@lordeji655 I agree with you on all points I'm just answering ur question

  • @lordeji655

    @lordeji655

    Ай бұрын

    @@multicoloredwiz AH sorry x)

  • @GajanandamaniAdhikari
    @GajanandamaniAdhikariАй бұрын

    Bruh, what font is this. Sweet

  • @0xdeadbabe240

    @0xdeadbabe240

    Ай бұрын

    Iosevka

  • @bufferc6362
    @bufferc6362Ай бұрын

    I love you.

  • @tianned
    @tiannedАй бұрын

    38:18 expectation 38:34 reality 42:25 42:32 Mr Zozins explanations are the best imo, probably would become a great teacher if he wished to

  • @MasterHigure

    @MasterHigure

    Ай бұрын

    Macro source is as unreadable in C as it is in Rust.

  • @tiwanndev
    @tiwanndevАй бұрын

    what do you mean google shitiness

  • @RealCatDev
    @RealCatDevАй бұрын

    when Vulkan?

  • @wildwestrom

    @wildwestrom

    Ай бұрын

    He did a Rust Vulkan stream awhile ago. Quite useful imo

  • @RealCatDev

    @RealCatDev

    Ай бұрын

    @@wildwestrom I don't care about some smelly bad language

  • @bhavyakukkar

    @bhavyakukkar

    Ай бұрын

    ​@@RealCatDev then why are you watching this video

  • @RTZemun

    @RTZemun

    Ай бұрын

    ​@@bhavyakukkar he probably wants to say that rust is a bad language and that he wants to see vulkan in C

  • @RealCatDev

    @RealCatDev

    Ай бұрын

    @@RTZemun yes

  • @KnightOfEvil
    @KnightOfEvilАй бұрын

    Why captions are just Twitch Chat. Is that a mistake?

  • @p99chan99

    @p99chan99

    Ай бұрын

    No he implemented it himself

  • @multicoloredwiz

    @multicoloredwiz

    Ай бұрын

    No it's tigjt

  • @mmmmm1438
    @mmmmm1438Ай бұрын

    you say what welcome to ? what

  • @AnksioXD

    @AnksioXD

    Ай бұрын

    recreational programming session

  • @DanelonNicolas
    @DanelonNicolasАй бұрын

    Great 🎉

  • @marcsfeh
    @marcsfehАй бұрын

    mm nice

  • @aniketbisht2823
    @aniketbisht2823Ай бұрын

    Seeing you use macros all over the place gives me aneurysms, as a C++ programmer. I guess this is what "production" C looks like because you need generics and meta-programming in large projects. In C++ using templates (with concepts) and function overloading helps you achieve this (along with little bit of constexpr). You said you are not a fan of "dynamic" languages. Here C is no better than those dynamic languages. Whereas in C++ most (generic programming) errors would be caught at compile time and the usage of static_asserts and concepts make those errors easy to reason about. 44:04 It's embarrassing to see this dude. This function macro, in C++, could have been a simple function template (with appropriate constraints).

  • @monad_tcp

    @monad_tcp

    Ай бұрын

    C++ template metaprogramming is the embarassing thing

  • @D-V-O-R-A-K
    @D-V-O-R-A-KАй бұрын

    WHERE RED CAR???

  • @skilz8098
    @skilz80986 күн бұрын

    I couldn't stop laughing at about @1:30:40 in the video, I could hear the perfect background song starting to play in the back of my mind... kzread.info/dash/bejne/d42WmpZ7dLDImZM.html

  • @dorktales254
    @dorktales254Ай бұрын

    you mean twitch.tuvalu right? right?