• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

MSPhysics 1.0.3 (16 October 2017)

Scheduled Pinned Locked Moved Plugins
920 Posts 170 Posters 882.9k Views 172 Watching
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.
  • R Offline
    robint
    last edited by 31 Dec 2016, 10:07

    Anyone know how to put sound into script eg a sound wav called "cannon" to be played when I press space bar (which also fires the cannon ball

    I put the sound byte into the UI sound tab, but nothing happens? WOTODO?

    Robin

    As one door closes another one slams in your face

    1 Reply Last reply Reply Quote 0
    • P Offline
      PituPhysics
      last edited by 1 Jan 2017, 09:51

      @robint said:

      Anyone know how to put sound into script eg a sound wav called "cannon" to be played when I press space bar (which also fires the cannon ball

      I put the sound byte into the UI sound tab, but nothing happens? WOTODO?

      Robin

      Hello Robin. I wrote a script to display the distance of bullet and target, the time of flight and play the sound. But the "Update Timestep" change it to Normal 1/60 on the Simulation tab.

      Try this:

      mortar 2.skp

      1 Reply Last reply Reply Quote 0
      • S Offline
        SketchyPhysicsNutt
        last edited by 1 Jan 2017, 10:56

        Great script inside PituPhysics 'Distance and time of flight' perfect for projectiles

        thx
        Tez

        1 Reply Last reply Reply Quote 0
        • R Offline
          robint
          last edited by 2 Jan 2017, 16:49

          Hi PP

          some good stuff there, doesnt make the sound?

          take a look at my falling block as it uses the ontouch procedure to capture the distance at the moment of first impact

          Another way might be to insert some magnetism into the ball, floor and target so that the missile sticks to its first landing place, as with a real mortar

          Have tried to use magnetism in UI but doesnt seem to have any effect? 😲

          What am I doing wrong?

          Robin


          mortar 3.skp

          As one door closes another one slams in your face

          1 Reply Last reply Reply Quote 0
          • P Offline
            PituPhysics
            last edited by 3 Jan 2017, 22:24

            I made more models to be more opportunities.

            1.) Frozen: mortar 4.1.skp

            2.) Hide: mortar 4.2.skp

            3.) Simulation pause: mortar 4.3.skp

            And magnet test:magnet.skp

            1 Reply Last reply Reply Quote 0
            • R Offline
              robint
              last edited by 4 Jan 2017, 09:40

              Hi PP

              tried your magnet and I am baffled as to why its so very slow, <2fps. tried everything to speed it up. Sketchy physic was much faster? I made ther executive balls desktop toy by putting all the balls as pendulums in a frame and colliding. It was fast and realistic?

              Robin

              As one door closes another one slams in your face

              1 Reply Last reply Reply Quote 0
              • R Offline
                robint
                last edited by 4 Jan 2017, 10:12

                Even stranger, I managed to get my balls to clang together at 30 fps, but unable to simulate repulsion even with negative magnet values? I notice that perhaps magnet is a wrong term as it behave more like gravity between two masses (hence no repulsion effect)

                Universal gravitation equation

                F = GMm/R2
                

                where

                F is the force of attraction between two objects in newtons (N)
                G is the Universal Gravitational Constant = 6.674*10βˆ’11 N-m2/kg2
                M and m are the masses of the two objects in kilograms (kg)
                R is the separation in meters (m) between the objects, as measured from their centers of mass
                

                notice how the ball is attracted to the target even though the target has no magnetic force

                for example

                Robin


                my magnetic balls 1.skp

                As one door closes another one slams in your face

                1 Reply Last reply Reply Quote 0
                • R Offline
                  robint
                  last edited by 4 Jan 2017, 11:38

                  Hi PP

                  Got as far as 4.3 and it certainly is the cats whiskers, like the disappering effect in 4.2, all we need is a little pop up explosion (still no sound on mine?)

                  I dont understand what is affecting the fps so drastically? It goes from 30fps down to 4 or less

                  Robin

                  As one door closes another one slams in your face

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    robint
                    last edited by 4 Jan 2017, 12:36

                    Playing with real shells. Wonder how I can get the nose pointing along the path? hmmm ❓ notice the fps is 27, yet on some of the models its very slow 2fps


                    mortar 5.1.skp

                    As one door closes another one slams in your face

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      PituPhysics
                      last edited by 4 Jan 2017, 19:05

                      For me 63 fps.

                      mortar 5.2.skp

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        robint
                        last edited by 4 Jan 2017, 19:39

                        Wow PP that has blown me away, havent looked into detail yet, tomorrow am

                        Now could this be mounted on a tank? Forward, left, right track

                        Then we could have two or more, multi players

                        Tank battle, forests, obstacles, terrain, mines, smoke etc

                        Pls assume all rights, I'll be your beta tester and write the manual

                        Robin

                        Ps I wrote a game like this in BASIC years ago, for four players, it was extemely addictive, hidng under tree cover trying to guess where you opponents were. Each tank had a home base corner and had to return for new ammo and fuel. we spent hours on it

                        I turned this into a kids game sliding around on mats on a polished wood floor blindfold, getting coded instruction from their base commanders. They fired foam tennis balls at each other and only had three reserve tanks. Couldn't get them out of the classroom, oh and they had to give their instructions in a foreign language, French German, Italian and swedish - a summer uni job - but the kids loved it

                        Robin

                        As one door closes another one slams in your face

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          robint
                          last edited by 7 Jan 2017, 08:38

                          Hi PP
                          changed the angle so its a cannon 0 - 80deg azimuth control
                          just gets better πŸ˜„


                          mortar 5.3.skp

                          As one door closes another one slams in your face

                          1 Reply Last reply Reply Quote 0
                          • I Offline
                            INVR
                            last edited by 12 Jan 2017, 00:31

                            I have a little issue where sometimes when I run the sim (simple hinges) it starts scanning and objects seem to disappear. I can control the camera and see them or half of the object. But it gets worse and worst until I have to reset it. Is there any steps I can take to fix this?

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              Anton_S
                              last edited by 12 Jan 2017, 20:25

                              INVR, camera clipping is very like caused by some objects falling down too far away from camera. To fix this, find the objects that fall down non stop and draw a floor below them or set them to ignore if they are not necessary for the simulation. These objects could be hidden groups or hidden layers. So uif you unhinde everything, and run simulation, you should be able to notice which objects do that.

                              1 Reply Last reply Reply Quote 0
                              • F Offline
                                faust07
                                last edited by 14 Jan 2017, 12:43

                                Testing "export replay to images" in SketchUp 2017.
                                The result is incomplete images with always the same empty white parts..
                                The same happens when using the following line in a MSPhysics script:

                                Sketchup.active_model.active_view.write_image("e;/MSPh_Temp/frame_%06d.png" % frame,1600,900,true,1.0)
                                

                                How should it be right for SUp 2017?

                                1 Reply Last reply Reply Quote 0
                                • F Offline
                                  faust07
                                  last edited by 18 Jan 2017, 17:47

                                  Hi, Anton. Here I have yet an other question:
                                  It would be great if, for example, there would be a mode for the servos to hold the joint exactly at the center of rotation and completely prevent the centrifugal forces and the pulling out of the components involved.
                                  In the enclosed example, I have not found any way to keep the outer sections of the wings exactly at the center of rotation of the servos. There always develops a gap between the parts.
                                  Have screwed at all settings and nothing was useful.
                                  It seems to be a kind of inertia of the outer wing segments, which can not be stopped by reducing weight, gravitation, friction, etc.


                                  TestBirdWing0001.gif


                                  WingTest-SUp-MSP_01.jpg

                                  1 Reply Last reply Reply Quote 0
                                  • L Offline
                                    luckyvac
                                    last edited by 25 Jan 2017, 15:46

                                    Hi Anton, is it possible to control the movement of a servo motor with a function of time. An Excel file ? In the command section can replace the slider by a function of time ( ontick ? ). ... thank you very match.

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      Anton_S
                                      last edited by 26 Jan 2017, 05:04

                                      Yes, luckyvac, it is possible to control servo angle through a function of time. There are lots of ways it can be done. One way is to simply write a function into the controller section of the the servo. Say, you want to control the angle of the servo, in degrees, with a function f(t) = t*3 + 150.
                                      Converting it to ruby and MSPhysics, the code would like like this: world.time * 3 + 150. If you paste this snippet into the controller section of a servo, it will have the servo angle be the value of this function at simulation time, t.

                                      1 Reply Last reply Reply Quote 0
                                      • L Offline
                                        luckyvac
                                        last edited by 27 Jan 2017, 08:51

                                        Hello Anton,

                                        Thank you for your reply. I will need more knowledge to carry out my project.

                                        I am guitarist and I teach guitar accompanying songs.
                                        This project aims to realize a tutorial to learn how to play the accompanying guitar and to show that one can realize accompaniments guitar with 5 or 6 rhythmic figures.

                                        http://www.luckyanimationspectacle.com/index.asp?pageid=33

                                        I used MSPhysics to simulate the movement of the arm and hand of a guitarist holding a pick.
                                          He accompanies guitar with a song following the rhythm 1-2-345et.
                                        Fig.01 As an attachment. pierrot robo guitar

                                        I used 2 servomotors:

                                        • one for the forearm which operates the up and down of the forearm.
                                        • a second for the descent of the hand.
                                          I made a stop-motion video by adjusting the two actuators point by point according to the following diagram:
                                          Fig.02 As an attachment 1-2-345et

                                        I would like to replace the slider by time functions, point by point (FIG. 2) or FFT.

                                        The displacement coordinates of the servomotors are shown in the table in figure 02.
                                        You will find the simulation with the <FOREARM> (avant bras ) and <HAND> (main ) slider in my drive and an example video. I chose the refrain of Bob Dylan's "blowin in the wind".
                                        Here is the link :
                                        https://drive.google.com/open?id=0B00m7nJr8D_qTnRXX3AyeWVyZmc
                                        The video tutorial shows the synchronized movement with a rhythmic tablature made with Guitar Pro MIDI (*.gpx, *.mid ). There is no human, just my voice πŸ˜‰.

                                        I thank you for your attention and information you can communicate to me to help me realize my project.

                                        Best regards

                                        jean-luc alias luckyvac... lucky guitaR


                                        perrot robo guitar.png


                                        figure 2 _  1-2-345et_ 24 images.jpg

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TheSniper
                                          last edited by 1 Feb 2017, 15:17

                                          Anton Awesome Plugin Thanks for the hard work!
                                          I add And not to complain but hopefully to help.
                                          Platform: Sketchup 2017 on Mac 64 bit
                                          Known issues: 1 setting dont get saved in multiple areas for instance in the Joint and Piston Settings: Max and Min wont save always defaults back to -393.7007874, as well as the controller line resets back to default values. Controller name wont transfer over either. In the Servo panel: cannot save custom servo names, Plus Servo Max and MIn wont save either. Just some examples. Hope it helps. -S

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 25
                                          • 26
                                          • 27
                                          • 28
                                          • 29
                                          • 45
                                          • 46
                                          • 27 / 46
                                          27 / 46
                                          • First post
                                            539/920
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement