Programming Procedural Animations

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 42

  • @NoVIcE_Source
    @NoVIcE_Source 3 місяці тому +5

    1:20 oh my god this slowed down and then sped up visualization was amazing
    a picture is worth a thousand words, and a video can be worth a thousand pictures :D

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +1

      Thank you for the comment! Coding that example was a last minute decision. So, I’m really glad to hear it was useful.

  • @prietjepruck
    @prietjepruck 3 місяці тому +2

    This is all so clear to me. You should be a teacher. Thanks Terry, I always enjoy your videos.

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +3

      Wow, thanks! I am a teacher, so it’s great to hear that I’m doing a decent job at it.

  • @monkeygame7
    @monkeygame7 3 місяці тому +2

    I think it would be really cool to combine this technique with something like Boid's algorithm and get whole flocks of creatures moving around like this!

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +1

      That’s a great idea! It should give really interesting results depending on the length of the creatures.

  • @ЕвгенийСобо
    @ЕвгенийСобо 2 місяці тому +2

    Thank you for the video. I've been trying to figure out inverse kinematics for a long time and you helped a lot.
    I was able to reproduce your Processing in Python.
    I hope to eventually implement it in Godot and try to add paws to the fish.

    • @programmingchaos8957
      @programmingchaos8957  2 місяці тому

      You’re welcome. I’m glad it was helpful. Which graphics library do you use with Python? I’ve played with Godot a little bit, but mostly use Unity for game development.

    • @ЕвгенийСобо
      @ЕвгенийСобо 2 місяці тому +1

      @@programmingchaos8957 I use a mod in the Processing program, it's called "Python Mode for Processing", by Jonathan Feinberg

    • @programmingchaos8957
      @programmingchaos8957  2 місяці тому +1

      I should have guessed :) I've used the Python version myself a little bit, but I'm so used to Java in the Processing environment that when I switch languages in Processing I make all sorts of mistakes. It's like I need to use a different IDE for each language so my brain knows what language I'm using.

  • @Akadefu
    @Akadefu 2 місяці тому +2

    Amazing! Will work with you soon, for Research in machine Learning Algorithm. Thank you!

  • @flameofthephoenix8395
    @flameofthephoenix8395 3 місяці тому +2

    They seem to all look a lot like tadpoles. That's very nice!

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +1

      Thanks! You're right that there's a strong resemblance to tadpoles. I tried to lean away from the look because it's too easy to get misinterpreted as other large headed swimmy things and I didn't want to get in trouble with the UA-cam algorithm :)

    • @flameofthephoenix8395
      @flameofthephoenix8395 3 місяці тому

      @@programmingchaos8957 Yeah, hopefully the algorithm will be deterred by the eyes and rainbow colors that most of them have.

  • @jKmusixs
    @jKmusixs 3 місяці тому +1

    Thanks for answering man , for the enviroment,
    I am going back to get the whole knowledge i can get from this video..

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому

      I hope it you get a lot out of it. I was pretty happy with how the creature movement ended up looking.

  • @zeph199-n4x
    @zeph199-n4x 3 місяці тому +1

    Thank you this was amazing

  • @Milky-Way72
    @Milky-Way72 2 місяці тому

    going to try to implement this in 3D haha

  • @clamhammer2463
    @clamhammer2463 3 місяці тому

    This is a great video. I saw that you mentioned working in other languages. You might find better traction on youtube swapping out java for a more popular language/framework. For example, Javascript with p5.js. I'm not super familiar with p5 but I'm sure that it has all of the features needed to recreate this concept with it. This is just one example though. Either way, this was fun to watch.

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому

      Thanks for the comment and the suggestion. I've programmed a reasonable amount in Javascript, but haven't taken the time to work with p5.js much. I've been tempted to use C++, but installing it for graphics might be a pain for viewers.

    • @surajmandal_567
      @surajmandal_567 3 місяці тому

      ​@@programmingchaos8957Which graphics library u intend to use with c++

  • @bertofnuts1132
    @bertofnuts1132 3 місяці тому

    Nice, but at 26:36, may I suggest a simple: `(TWO_PI + angle % TWO_PI) % TWO_PI;`

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому

      Thanks for the reminder. I regularly switch between languages, not all of which have a TWO_PI or use a different convention for formatting constants. So, I find it easier to use 2*PI then to try to remember which form the constant takes. I'm curious if you know if 2*PI would be precomputed when the Java is compiled into byte-code. I couldn't find a definitive answer.

    • @bertofnuts1132
      @bertofnuts1132 3 місяці тому

      @@programmingchaos8957 As documented it is the number 6.28... and in Java there are no "#define'd constants" only "uppercase variables", so it is at worst a variable fetch. But my point is more the use of the modulo instead of iterating additions/subtractions.

    • @bertofnuts1132
      @bertofnuts1132 3 місяці тому +1

      @programmingchaos8957 As documented it is the number 6.28... and in Java there are no "#define'd constants" only "uppercase variables", so it is at worst a variable fetch. But my point is more the use of the modulo instead of iterating additions/subtractions.

    • @programmingchaos8957
      @programmingchaos8957  2 місяці тому

      Ah, that is a good point. My personal problem is that not all languages handle modulo with decimals (or it's a newer feature). So, in a given language I can't always remember if its valid or not - hence relying on addition/subtraction.

  • @denielalain5701
    @denielalain5701 Місяць тому

    Hello! What sort of procedural techniques would you use to code a sidewinder snake's animation?

    • @programmingchaos8957
      @programmingchaos8957  Місяць тому +1

      That's an excellent question. With the algorithm in the video movement tends to 'dampen out' whereas sidewinders maintain a fairly strong curve over their whole body. Watching some videos of them it looks like maybe all of their body 'segments' move through the same spaces/curves. So, something more like a traditional snake game snake, but with the head moving in sin() wave might be a good starting point. It's also possible that someone has already figured out the algorithm and posted it, but if so, I haven't seen it. If you make any progress on this, I'd love to hear about it.

    • @denielalain5701
      @denielalain5701 Місяць тому

      @@programmingchaos8957 For me it looks like it is stepping with its head, or neck. Based on its trail i can see that there are always two contact points to it with the ground. This reminds me of a cork screw that is rolling with its tip that is like the snake's head region, or rather the neck of it because it keeps its head away from the ground. Also the trail of it looks like the tangent function a littlebit

    • @programmingchaos8957
      @programmingchaos8957  Місяць тому +2

      Good observations. The bit about looking like a corkscrew might be a clue as to how to model it. The whole body shaped roughly like a corkscrew, but with each section progressing through the curve.

    • @denielalain5701
      @denielalain5701 Місяць тому

      @@programmingchaos8957 Humanoid things have their feet on the ground while they are stepping too. I can imagine the place where the snake puts its neck to the first time as a humanoid foot step. Basically the segments must go through that first footprint first, and then towards the neck of the snake. After that spot there is a straight part on which the snake "stands", and then a turn which is the last stationary place of the snake's step. Each snake step consists of two turns, and a straight part, that is two stationary points Everything after that has to go through these stationary points before it can go towards the snake's head, but also only these segments are not touching the ground so these are the suspectible to curve when the snake turns. After that there are going to be two additional points where the snake "stands" with its tail part like a leg behind. These two points are also stationary. So i would place a point where the snake puts its neck not its head first, and then make an additional point at a certain distance from the first, at a certain angle compared to the direction the snake went when its neck step "touched" the ground, and then pull everything through these two points first. I would also make sure that the snake does exactly two steps before it "runs out" by tuning its initial two points' distance, and the snake's length.

  • @jvcmarc
    @jvcmarc 3 місяці тому

    for a second I thought this was a follow up from argonaut's video, the creatures are very similar! Was their video an inspiration for this exercise?

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +1

      I watched several videos, and read a couple of blog posts, before putting this together. But you one of them was argonaut's video - good spotting. Of the techniques I looked at this one seemed the simplest to code.

  • @MissPiggyM976
    @MissPiggyM976 3 місяці тому +1

    Good, but too small for a mobile screen.

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому

      Thanks! I’d like to make a mobile version, but I don’t see a good way to handle the programming portion.

  • @KD56100
    @KD56100 3 місяці тому +1

    This was borrowed/stolen from the work published here 4 month ago:
    ua-cam.com/video/qlfh_rv6khY/v-deo.html&

    • @programmingchaos8957
      @programmingchaos8957  3 місяці тому +4

      Hi. This is a pretty well known technique that's been around for quite a while. I thought having a version that stepped though the programming could be useful for some viewers. To be clear almost none of the algorithms I present (or that are in most UA-cam videos) are completely original. For example, my previous video was on genetic algorithms, which go back at least to John Holland's work in the 1970's. I'm just trying to present algorithms in a way that is helpful to the viewers. I have to say that argonaut's video is very impressive, and possibly does a better job of illustrating the idea than my own - thanks for pointing it out.