• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Frames

Scheduled Pinned Locked Moved SketchyPhysics
6 Posts 3 Posters 535 Views 3 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.
  • H Offline
    hobbnob
    last edited by 22 Mar 2009, 15:10

    I was wondering: Is it possible to have a random movement in frames? It's just that I've made a frame powered aircraft (the first on the warehouse) and i was wondering if it's possible instead of having programmed functions like a bit left a bit right etc it could be random. also, can someone explain the script? i can put it in and change the moving values, but don't want to touch anything just in case. can someone help please?

    My WIP Thread:Here

    1 Reply Last reply Reply Quote 0
    • W Offline
      Wacov
      last edited by 22 Mar 2009, 16:51

      'rand' generates a random value bigger than 0 and smaller than 1. It'll refresh every frame, but there's no way at the moment to stop this; if it's too fast, I guess you could decrease the joint's accel, but there's not that much you can do from within the script. I'm not sure what you mean by 'explain the script'... can you go into more detail?

      http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

      1 Reply Last reply Reply Quote 0
      • H Offline
        hobbnob
        last edited by 23 Mar 2009, 16:02

        What i mean is: I've learnt this code: [0,1,0,1][(frame/50)%5]
        however the only bit i know about is the [0,1,0,1] bit,omeone xplain what the other bits do?

        My WIP Thread:Here

        1 Reply Last reply Reply Quote 0
        • W Offline
          Wacov
          last edited by 23 Mar 2009, 16:08

          Have a look at this thread, I posted a pretty thorough guide:
          http://www.sketchucation.com/forums/scf/viewtopic.php?f=61&t=17539&start=0

          http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

          1 Reply Last reply Reply Quote 0
          • H Offline
            hobbnob
            last edited by 23 Mar 2009, 18:08

            ok i understand the 50 bit now, but i don't have a clue about th %5 bit, please help!

            My WIP Thread:Here

            1 Reply Last reply Reply Quote 0
            • C Offline
              CPhillips
              last edited by 23 Mar 2009, 19:17

              %5 means "Modulo 5" in math terms:
              http://en.wikipedia.org/wiki/Modulo_operation

              In this case it makes sure that frame/50 is never more that 5. Once it reaches 5 it will start at 0 again.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                3/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement