• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [ANSWERED] Footprints following a performer randomly walking on a stage

    How To... ?
    4
    12
    243
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DusX
      DusX Tech Staff @mark_m last edited by

      @mark_m

      #1: unsure what your looking for here.. maybe use some type of delay line?

      #2: Using a little trig. If you have the current XY, and you have the past XY via a delay line, you can calculate the rotation.

      #3: Using the same current and past XY, you can use the Velocity actor to watch speed and adjust as needed.

      I am attaching some JS I use to get angles between 2 XY points.

      // input1: X of rotating thing (Izzy range -50 to 50)
      // input2: Y of rotating thing (Izzy range -50 to 50)
      // input3: X of focus item eg: mouse (Izzy range -50 to 50)
      // input4: Y of focus item eg: mouse (Izzy range -50 to 50)
      // input5: stage width (pixels)
      // input6: stage height (pixels)
      function rotate(focusX,focusY,selfX,selfY,wPercent){
        //distance of focus from self
        var dx = focusX - selfX;
        var dy = focusY - selfY
        debug("vars. dx: " + dx  + " dy: " + dy + " wPercent: " + wPercent + "\n");
        return (Math.atan2( (dy * wPercent) , (dx) ) );
      }
      function rad2deg(rad){
        return rad * (180 / Math.PI);
      }
      function debug(printString){
          if (DebugMode){
              print(printString + "\n");
          }
      }
      function main(){
        // DO setup here: ONCE ONLY ************************************************
          DebugMode = false; //example usage: debug("string" + var + "\n");
          // main function for LOOP **************************************************
          main = function(){
            // get focus XY from Izzy enviroment
              var focusX = arguments[2]; // reverse due to flipped X in Izzy
              var focusY = arguments[3]; // reverse due to flipped Y in Izzy
            // get current Self Position
              var selfX = arguments[0]; // center for now
              var selfY = arguments[1]; // center for now
            // used to normalize the w/h at 100%
              var wPercent = arguments[5] / arguments[4];
            debug("vars. mX: " + focusX  + " mY: " + focusY + " sX: " + selfX + " sY: " + selfY + "\n");
                return [ rad2deg( rotate(focusX,focusY,selfX,selfY,wPercent) ) * -1]; // *-1 added to rotate other direction
          };
          // RUN ONCE FOR INIT ONLY
          var out = []; // declare out
          return out; // return from INIT state
      }

      and the JS being used.

      Troikatronix Technical Support

      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
      • Isadora Add-ons: https://troikatronix.com/add-ons/
      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

      Running: Win 10 64bit, i7-8750H, M.2 PCIe SSD's, 16gb DDR4-2666, nVidia GTX 1070 | located in Ontario Canada.

      1 Reply Last reply Reply Quote 2
      • bonemap
        bonemap Izzy Guru @mark_m last edited by bonemap

        @mark_m said:

        you must have done this sort of thing...

         Hi,

        I do have something that I think will get you started... it is using the same principles suggested by @DusX, but packaged up in a demonstration patch. 

        blob-particle-follow.zip

        Best Wishes

        Russell

        http://bonemap.com | https://github.com/bonemap | Australia
        Izzy 3 STD/USB 3.2.1 | MBP 16” 2019 2.4 GHz i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | OSX 12.2 Monterey

        mark_m 1 Reply Last reply Reply Quote 3
        • mark_m
          mark_m @bonemap last edited by

          @bonemap @DusX

          Great, thank you so much! Those are the very things! I'm so grateful!

          Cheers

          Mark

          Intel NUC8i7HVK Hades Canyon VR Gaming NUC, i7-8809G w/ Radeon RX Vega M GH 4GB Graphics, 32GB RAM, 2 x NVMe SSD
          Gigabyte Aero 15 OLED XD. Intel Core i7-11800H, NVidia RTX3070, 32GB RAM 2 x NVMe SSD
          Homebrewed X99 Desktop, i7 5930, GeForce GTX980, 64GB RAM, Win10x64
          www.natalieinsideout.com

          DusX 1 Reply Last reply Reply Quote 0
          • DusX
            DusX Tech Staff @mark_m last edited by

            @mark_m

            I think you will also what to use Pythagoras to calculate the distance between your 2 reference points, so that you don't update the rotation unless the distance is greater than a set threshold.
            Bonemaps example is great, but if you stop moving the mouse you get some unwanted rotation changes with any small point updates.

            Troikatronix Technical Support

            • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            • Isadora Add-ons: https://troikatronix.com/add-ons/
            • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

            Running: Win 10 64bit, i7-8750H, M.2 PCIe SSD's, 16gb DDR4-2666, nVidia GTX 1070 | located in Ontario Canada.

            bonemap 1 Reply Last reply Reply Quote 1
            • bonemap
              bonemap Izzy Guru @DusX last edited by

              @dusx

              Hi,

              The javascript solution does efficiently resolve the issue of what happens when the movement stops. I have so much to learn - Thanks for sharing it! 

              @mark_m here is a screengrab how I was able to integrate @DusX javascript. Apologies done with a beta version so I can't share the patch file.

              Best Wishes

              Russell

              http://bonemap.com | https://github.com/bonemap | Australia
              Izzy 3 STD/USB 3.2.1 | MBP 16” 2019 2.4 GHz i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | OSX 12.2 Monterey

              mark_m DusX Woland 3 Replies Last reply Reply Quote 1
              • mark_m
                mark_m @bonemap last edited by mark_m

                @bonemap

                Thanks a lot! Will try that..

                Meanwhile, demonstrating that you can do anything many ways in Isadora... we used your (@bonemap's) original patch, and connected the 2D velocity actor to the blob tracker's X and Y output, and connected that to the pulse generator of the 3D Particle Generator. So that if the velocity was zero, no footsteps (particles) were emitted, and the faster you ran, the more footsteps got laid down.

                We also used the technique that you shared with us a while ago in your excellent tutorial on sprite animation to make left and right footprints!

                Here's a screen grab of this scene (the blob tracking itself is done in a secondary scene: the listeners get the x / y positions:

                And the video of our first, crude attempts: a quick demo to the director to show we were on the right track (no pun intended!).

                We'll get back to that and give it a go with the Javascript as well.

                Thanks Russell and Ryan, you're both marvellous!

                Intel NUC8i7HVK Hades Canyon VR Gaming NUC, i7-8809G w/ Radeon RX Vega M GH 4GB Graphics, 32GB RAM, 2 x NVMe SSD
                Gigabyte Aero 15 OLED XD. Intel Core i7-11800H, NVidia RTX3070, 32GB RAM 2 x NVMe SSD
                Homebrewed X99 Desktop, i7 5930, GeForce GTX980, 64GB RAM, Win10x64
                www.natalieinsideout.com

                1 Reply Last reply Reply Quote 3
                • DusX
                  DusX Tech Staff @bonemap last edited by

                  @bonemap said:

                  <p>@dusx</p><p>Hi,</p><p>The javascript solution does efficiently resolve the issue of what happens when the movement stops. I have so much to learn - Thanks for sharing it! </p><p>@mark_m here is a screengrab how I was able to integrate @DusX javascript. Apologies done with a beta version so I can't share the patch file.</p><img src="/assets/uploads/files/1634079469460-screen-shot-2021-10-13-at-8.50.35-am.png" /><p>Best Wishes</p><p>Russell</p>

                   Nice approach!

                  Troikatronix Technical Support

                  • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                  • Isadora Add-ons: https://troikatronix.com/add-ons/
                  • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

                  Running: Win 10 64bit, i7-8750H, M.2 PCIe SSD's, 16gb DDR4-2666, nVidia GTX 1070 | located in Ontario Canada.

                  1 Reply Last reply Reply Quote 1
                  • Woland
                    Woland Tech Staff @bonemap last edited by

                    @bonemap said:

                    Apologies done with a beta version so I can't share the patch file

                     Now that 3.1 is released, I'm itching to get my hands on this file 😅

                    TroikaTronix Technical Support
                    New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                    TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                    TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

                    | Isadora 2.6.1 + 3 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s | Macbook Pro (Retina, 15", Mid 2015), macOS 10.11.4, 2.8GHz Intel Core i7, 16GB RAM, Intel Iris Pro 1536 MB |

                    bonemap 1 Reply Last reply Reply Quote 0
                    • bonemap
                      bonemap Izzy Guru @Woland last edited by

                      @woland

                      Here it is! follow-particle.zip

                      Best Wishes

                      Russell

                      http://bonemap.com | https://github.com/bonemap | Australia
                      Izzy 3 STD/USB 3.2.1 | MBP 16” 2019 2.4 GHz i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | OSX 12.2 Monterey

                      Woland 1 Reply Last reply Reply Quote 0
                      • Woland
                        Woland Tech Staff @bonemap last edited by

                        @bonemap

                        Awesome! Do you mind if we make some tweaks and add some Comment actors then upload it and credit you, or do you want to upload it yourself?

                        TroikaTronix Technical Support
                        New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                        TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
                        TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

                        | Isadora 2.6.1 + 3 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s | Macbook Pro (Retina, 15", Mid 2015), macOS 10.11.4, 2.8GHz Intel Core i7, 16GB RAM, Intel Iris Pro 1536 MB |

                        bonemap 1 Reply Last reply Reply Quote 0
                        • bonemap
                          bonemap Izzy Guru @Woland last edited by

                          @woland

                          The Javascript is from @DusX so I would say the credit goes there for this one.

                          Best Wishes

                          Russell

                          http://bonemap.com | https://github.com/bonemap | Australia
                          Izzy 3 STD/USB 3.2.1 | MBP 16” 2019 2.4 GHz i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | OSX 12.2 Monterey

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post