• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

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

    Basic Physics Engine - Stage Edge Collision, with rebound / Gravity and Friction

    How To... ?
    6
    41
    23850
    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.
    • Marci
      Marci last edited by

      Been experimenting today trying to find a physics engine usable within Isadora without a great deal of success, mainly as the majority are coded to rely on the browserDOM or jQuery or another framework that isn't usable within Isadora. So, I went back to basics. I've started replicating Jorn Zaefferer's Bouncing Ball Sim! See http://jzaefferer.github.io/flocking/bouncing.html & http://bassistance.de/2011/12/09/vector-math-basics-to-animate-a-bouncing-ball-in-javascript/

      Refer to the attached screen cap (as I've left my dongle at work), and the attached TXT file which contains the source to copy and paste into the Javascript actor.
      It's no where near "done" yet. 2 balls, statically defined. Need to be able to add / throw balls based on gesture motion (via Kinect), calculating angle of launch and velocity as best possible... needs object collision detection, ball to ball, and eventually ball to skeleton, and an easy way to add static objects for others to collide with. Also needs an ability to define an object's mass and therefore inertia etc. THEN need to make it 3D rather than 2D.
      If you look at the source, you can suss out how to add more balls, as well as what position and direction they launch from / to. What you use to represent a ball is entirely up to you. I'm using TextDraw actor to keep it in GPU land. The output positions (x and y) are scaled -50 to +50.
      It has it's issues... doesn't account for object size, just centre point etc. All still to do. Just a Proof of Concept more than anything else. (aka I got bored)

      99c6fb-physics.jpg c0f640-physics.txt

      rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
      Warning: autistic - may come across rather blunt and lacking in humour!

      1 Reply Last reply Reply Quote 0
      • Marci
        Marci last edited by

        Dongle retrieved... updated patch attached! Can now click>drag>release on the stage in a throwing gesture to add/launch a new ball. It's patched in to support 7... but allows you to add an infinite number (I guess) 2761b4-physics.izz

        rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
        Warning: autistic - may come across rather blunt and lacking in humour!

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

          Funny. I have spent sometime over the past few weeks on this as well. More interested in 2d at the moment, although I may have a 3D physics lib that will work. Have to do more testing :) @Marci Did you find the IBM tutorial on building a physics engine with js?

          Troikatronix Technical Support

          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

          1 Reply Last reply Reply Quote 0
          • Marci
            Marci last edited by

            The one on DeveloperWorks? Yep... will probably head in that direction next. What's tripping me up is a lack of knowing what is and isn't supported within Izzy. No commonJS or AMD module stuff... exports & define not defined. No setInterval or setTimer... not defined (hence needing the pulse generator actor). Had a look at EnvJs to give us some window/document model emulation and gave up. I need to forget all the shortcuts I've become used to as a web developer. Also need to run some GarbageCollection tests (does GC take place in Izzy's implementation?). It may be easier to set up a separate node.js server, do all the logic in that, and just ship variables back and forth via JSON & send TCP actor or I can see CPU & mem usage spiralling out of control within an Izzy patch quite quickly.

            rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
            Warning: autistic - may come across rather blunt and lacking in humour!

            1 Reply Last reply Reply Quote 0
            • Marci
              Marci last edited by

              Hmmm - just been reading http://www.dusxproductions.com/blog/pro-tip-jstips-init/ Think I may have coded it all wrong...

              rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
              Warning: autistic - may come across rather blunt and lacking in humour!

              1 Reply Last reply Reply Quote 0
              • Skulpture
                Skulpture Izzy Guru last edited by

                To simple get a bouncing ball interact with the outline of a person using a kinect would be mind blowing. To hit a persons leg and bounce off, etc.

                It would open up a world of ideas and possibilities.

                Graham Thorne | www.grahamthorne.co.uk
                RIG 1: Custom-built PC: Windows 11. Ryzen 7 7700X, RTX3080, 32G DDR5 RAM. 2 x m.2.
                RIG 2: Laptop Dell G15: Windows 11, Intel i9 12th Gen. RTX3070ti, 16G RAM (DDR5), 2 x NVME M.2 SSD.
                RIG 3: Apple Laptop: rMBP i7, 8gig RAM 256 SSD, HD, OS X 10.12.12

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

                  The V8 engine core handles garbage collection.
                  The JS features are the 'built in functions', and nothing from DOM/web stuff.

                  I think this list breaks it down: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects  (although its Mozilla, and not Google)?
                  @Skulpture  :) Thats the sort of think I am working towards.... a tutorial will come if I am successful.

                  Troikatronix Technical Support

                  • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                  • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                  • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                  Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

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

                    @Marci

                    No need for node.js for this.. 
                    My tests are going well. I have a modified version of Goblin physics running. (I picked this one since it seems to have zero dependencies and was created to be platform independant)
                    So far so good.

                    Troikatronix Technical Support

                    • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                    • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                    • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                    Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                    1 Reply Last reply Reply Quote 0
                    • jhoepffner
                      jhoepffner last edited by

                      Hello,

                      I am currently working hard on the Isadora/Unity connection. researching on programming and understanding of C#.
                      My project is principally linked ro real time 3D (geometrically exact) mapping with moving surface, more as anamorphosis opposed to corner pin. The project allow use of shifted beamers on complicated surfaces, via Syphon and OSC.
                      The inherent possibilities inside Unity 3D concerning gravity, collisions etc. are huge! And that will be the next step to explore.
                      I am preparing a demo and a communication on this material for the next London Isadora conference, any idea of a precise time?
                      I would be very pleased to share some info with you on the question.
                      All the best, Jacques

                      Jacques Hoepffner http://hoepffner.info
                      GigaByte 550b / Ryzen 7 3800X / Ram 64 Go / RTX 3090 24 Go / SSD 2 To / raid0 32 To
                      MBP 13' i5 2.6 Ghz 16 Go / Intel Iris / macOs 10.11.6 / izzy 2.6.1 + 3.0.3b2
                      MBP 15' i7 2.6 Ghz 16 Go / GTX 650M 1Go/ MacOs10.13.3 / Izzy 2.6.1
                      MSI GS65 i7 3.6 Ghz 32 Go / GTX 1070 8 Go / Windows 10 / Izzy 3.0.3b2

                      1 Reply Last reply Reply Quote 0
                      • Marci
                        Marci last edited by

                        @DusX - Goblin Physics just caused Izzy to CTD whenever I tried to crowbar it in there. Dunno what was causing it. Abandoned it to play with CoffeePhysics... which I've had some success with, altho defining the bounds of the world to the bounds of the stage seems impossible. Look forward to seeing your Goblin Physics implementation.

                        rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
                        Warning: autistic - may come across rather blunt and lacking in humour!

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

                          I am in contact with the dev. 
                          I got it working, but collision is an issue.. (hard crash) The dev has been very helpful... so

                          I hope to get further soon.
                          BUT... I have box2Dweb working great! (no 3D sorry) I hope to have more news soon.

                          Troikatronix Technical Support

                          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                          1 Reply Last reply Reply Quote 0
                          • Armando
                            Armando Beta Gold last edited by

                            Phisical Modelling (for pure data) port for Isadora is possible. The author is an old friend Cyrille Henry (Mark met him when I invited both on a workshop ar the Monaco Dance Forum in December..... 2004).

                            Cyrille is an open source guy so everything is available for c people and for Javascript. Can't do any of them but here is a big help
                            ready, set... [pmpd](https://puredata.info/downloads/pmpd)

                            8596f5-pmpd.pdf

                            Armando Menicacci
                            www.studiosit.ca
                            MacBook Pro 16-inch, 2021 Apple M1 Max, RAM 64 GB, 4TB SSD, Mac OS Sonoma 14.4.1 (23E224)

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

                              @Armando, thanks

                              I will take a look at that.
                              Where I am with this so far, 
                              A proof of concept for 2D physics in Isadora :)
                              https://youtu.be/nGRrwlWq14E

                              Troikatronix Technical Support

                              • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                              • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                              • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                              Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                              1 Reply Last reply Reply Quote 0
                              • Marci
                                Marci last edited by

                                @DusX: I got it working, but collision is an issue.. (hard crash) The dev has been very helpful... so

                                _I hope to get further soon._

                                Yep - that was about where I'd gotten to with it. Spotted the dev using the .on method in collision events to monitor his listeners and there my Goblin-fun stopped. It's only dependency is that it requires something to provide that event layer for collisions.

                                Instead have spent some time adding weight to the NI Mate Skeleton (i.e.: adding 3d torso and limb objects to the skeleton output) - each individual object done in CInema4D so i can get out the mesh co-ords to throw into whatever ends up being suitable for 3D use, and chucked that all into an Izzy patch.
                                So, I've got my 3D Avatar ready to place in the 3D space and collide with, all scalable to suit different builds of person, so that the collisions can occur with a suitable surface rather than a line with a static radius added.

                                rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
                                Warning: autistic - may come across rather blunt and lacking in humour!

                                1 Reply Last reply Reply Quote 0
                                • Marci
                                  Marci last edited by

                                  Modification of original patch - 10 x balls available. 3D position / collision / gravity / friction.

                                  NB: Collision point is still unfortunately) centre point of each ball, not surface point, mainly because at this stage the radius / diameter of each ball is determine by the ALL scale value on each 3D Player which comes after the JS. AND, balls still don't come to an actual stop. Zip file contains Ball and Plane OBJ files.

                                  56cb84-physics2.izz 4a52c8-3d-objects.zip

                                  rMBP 11,3 (mOS 10.13) / rMBP 11,4 (mOS 10.14) / 3x Kinect + Leap / TH2Go
                                  Warning: autistic - may come across rather blunt and lacking in humour!

                                  1 Reply Last reply Reply Quote 0
                                  • Skulpture
                                    Skulpture Izzy Guru last edited by

                                    http://www.creativeapplications.net/processing/kinect-physics-tutorial-for-processing/

                                    The video in this is amazing!

                                    Graham Thorne | www.grahamthorne.co.uk
                                    RIG 1: Custom-built PC: Windows 11. Ryzen 7 7700X, RTX3080, 32G DDR5 RAM. 2 x m.2.
                                    RIG 2: Laptop Dell G15: Windows 11, Intel i9 12th Gen. RTX3070ti, 16G RAM (DDR5), 2 x NVME M.2 SSD.
                                    RIG 3: Apple Laptop: rMBP i7, 8gig RAM 256 SSD, HD, OS X 10.12.12

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

                                      Hmm.. I need a connect.

                                      Troikatronix Technical Support

                                      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                                      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                                      • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                                      Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                                      1 Reply Last reply Reply Quote 0
                                      • Michel
                                        Michel Izzy Guru last edited by

                                        @DusX

                                        Or a Persee for the long run. I have ordered one.

                                        Best Michel

                                        Michel Weber | www.filmprojekt.ch | rMBP (2019) i9, 16gig, AMD 5500M 8 GB, OS X 10.15 | located in Winterthur Switzerland.

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

                                          too late for the indiegogo campaign

                                          Troikatronix Technical Support

                                          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                                          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                                          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                                          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                                          1 Reply Last reply Reply Quote 0
                                          • Michel
                                            Michel Izzy Guru last edited by

                                            yep, it finished a few days ago.

                                            Michel Weber | www.filmprojekt.ch | rMBP (2019) i9, 16gig, AMD 5500M 8 GB, OS X 10.15 | located in Winterthur Switzerland.

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