sketchucation logo sketchucation
    • Login
    1. Home
    2. Mr.K.1
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 143
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Mouse Capture (Win32 API)

      I can but SU keeps it's own mouse click actions that mess with SketchyPhysics and will mess with the game.

      • right mouse click, always pops up a drop down menu(even when empty)
      • middle mouse click, has the default orbit tool
      • mouse scroll, has default camera zoom

      Is there a way to disable these? I tried adding things to the button events but it does not prevent the default SU actions.

      posted in Developers' Forum
      M
      Mr.K.1
    • RE: Cooperative online modeling

      Alright I can see the errors of my ways, would be a neat party trick and not much more.

      Thanks for the insight guys.

      posted in SketchUp Discussions
      M
      Mr.K.1
    • RE: Cooperative online modeling

      Actually I meant all the geometry created by others would appear in a locked group, so everyone has their own little bubble.

      Example, you make the first floor of a house and the other person builds the second floor on top of it, the second floor would just be a locked group that doesn't mess with your geometry.

      For starters I would exclude all textures because they can be way too big to transfer not to mention all the setting that revolve around them.
      Instead all the textures would just be presented as RGB colors on the other end.

      Not sure on components tho, they probably need to be unique for every user, maybe later on add some feature to allow common components and editing.
      Could get very annoying if someone messes it up.

      Added a very simple example


      multi-user.skp

      posted in SketchUp Discussions
      M
      Mr.K.1
    • Cooperative online modeling

      Search didn't yield any topics on this so forgive me if I missed it.

      The idea is to have several people working on the same model at the same time through an internet connection.

      I always thought such a thing is not feasible due to Ruby not having access to all Sketchup tools, but maybe it could work in a limited capacity (no text, no textures and simple geometry), or maybe I can't see the full picture of what it would take to make it work.

      A couple of essential elements:

      • with an added network file from basic Ruby files SU can gain UDP and TCP communication (used it for small multiplayer games before)
      • all the geometry from your modeling partner would go into a locked group in your model(or several groups for more people), this way you can't interfere with eachoters work but can still build on top of it
      • the models would synchronize every second/few seconds/maybe minutes
      • synchronizing would keep track then move/create/color geometry that changed since the last update

      I think all this is possible through Ruby commands and a smart change tracking system could keep the data transfer minimal.

      Am I still missing something that would make this useless?

      Would the community want/use such a plugin?

      posted in SketchUp Discussions sketchup
      M
      Mr.K.1
    • RE: Mouse Capture (Win32 API)

      OK maybe I wasn't clear.

      Reading the mouse input/clicks while I have it captured is the problem, how do you do that?

      posted in Developers' Forum
      M
      Mr.K.1
    • Mouse Capture (Win32 API)

      The idea is to capture the mouse via Win32 API so I can utilize all mouse buttons without Sketchup interfering (it's for a mini first person shooter in SketchyPhysics).

      Now I got it to work half way but I don't know how to read the buttons, and I know alot of you guys are more knowledgeable then me so I would appreciate the help.

      The working code I got sofar:

      • window handle
        getForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', [], 'L') window_handle = getForegroundWindow.Call()

      • capture mouse input
        setCapture = Win32API.new('user32', 'SetCapture', 'L', 'L') setCapture.call(window_handle)

      • release mouse (EDIT: fixed the input parameters)
        releaseCapture = Win32API.new('user32', 'ReleaseCapture', 'V', 'L') releaseCapture.call()

      So those are the parts that work, you can try it in the Ruby console directly, until releaseCapture is called SU wont get any mouse input.
      Now I a script that reads the mouse input/clicks while the mouse is captured.

      I have found a Ruby example for reading window input messages but I'm not sure how it is suppose to work, if it's the right way to do it at all.
      ` getmessage = Win32API.new('user32', 'GetMessage', ['p', 'l', 'i', 'i'], 'l')
      dispatchmessage = Win32API.new('user32', 'DispatchMessage', 'p', 'l')
      translatemessage = Win32API.new('user32', 'TranslateMessage', 'p', 'l')

      while getmessage.call(msg, 0, 0,0)
      dispatchmessage.call(msg)
      translatemessage.call(msg)
      end`

      posted in Developers' Forum
      M
      Mr.K.1
    • RE: SubSet of SketchyPhysics

      Well all animations in SP are actually made through the physics engine, if you remove that then you got no animation and most of the code is useless.

      Apart from borrowing a few tools it would probably be better to just start anew.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Problem with engine

      Ah the problem is you connected the servos to the same group, so they are each trying pull it in their direction while the other one holds them back.

      Best rule of thumb is have one movable group for each joint, added the fixed example.


      uav.skp

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Problem with engine

      Very hard to tell without the actual model, so try to upload that and we can have a look how your joint connections are set up.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Learn SketchyPhysics

      Not sure what exactly you are looking for but there is some information here:
      http://sketchyphysics.wikia.com/wiki/SketchyPhysicsWiki

      If you have specific questions we can anwser those

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Projet battles wheels

      Here is a simple SP model, you can then add the visual parts and arenas to it.


      battle.skp

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Pause a simulation to wait for input from Webdialog?

      Alright I put a little something together, took a small racing game and added question checkpoints.

      The important bits here are the yellow boxes, the small one has the HTML code and questions and the long ones are checkpoints that will pop up a webdialog and pause SP.

      @@questions = [["4+5+10*0 = ","9"],["Banana color","yellow"], ["The cake is a...", "lie"]]
      (small box)Here you can put in any question and result combo

      And on checkpoints(long boxes) edit the question=0 part to determine which question will be displayed from the @@questions array, the count starts at 0.


      race.skp

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Projet battles wheels

      Well it would be best if you started it off with a basic model that people can build on, give us a template so the models then on will be consistent.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Pause a simulation to wait for input from Webdialog?

      Ya that's not too difficult, I'll whip up something just need to do some tests because these SP manipulations can quickly crash SU.

      BTW, do you have an existing HTML for the quizzes so I can link things directly to that?

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Changing Command Icons of the Toolbar

      Ya I tried this several ways, text does change but the icons never do(hide, show, remove toolbar and add it again nothing changes).
      It seems SU only loads those images once and they can't be refresh through Ruby.

      posted in Developers' Forum
      M
      Mr.K.1
    • RE: SetCamera() function.

      Put this in the Scripted field of a group and it should work

      ontick{
       eye = position
       target = transformation.zaxis
       up = [0,0,1]
       camera.set(eye, target, up)
      }
      

      It will look from the center towards the Z axis of your group, so remove the top cover and orient it how you want, or attach it to something.
      With ontick there will be a 1 frame delay between the camera and the group, this can be very useful for vehicles as the camera starts to stretch and it's an easy speed effect.
      Change ontick into onpostframe and the camera stretch will be gone.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Changing Command Icons of the Toolbar

      Well I tested a couple of ideas on this and it doesn't seem to work, Ruby has very limited reach into SU tool/menu system so you can only really add things and not change them once that is done.

      You could do a little cheat by making two identical toolbars then hide the first and show the second, and vice versa.
      But again Ruby has no control over how the toolbars are positioned so it may end up being a silly jumping button.

      posted in Developers' Forum
      M
      Mr.K.1
    • RE: Archimedes' screw

      The problem here are shapes, you used cylinder and convexhull, those can't work as a screw, what you need to do is build a screw and hull out of grouped boxes.

      Example: http://sketchup.google.com/3dwarehouse/details?mid=b04c95f456cdf164b48529c4dbb2f193&prevstart=12
      Delete some of the balls so it will run smoother

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Another Hopefully Easy question...

      Window -> Layers
      and then disable/enable Physics Joints layer

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Question regarding Sketchy physics

      Easiest way to make it a standalone animation is by recording a video.

      Otherwise you first need to find/write the code for a C# or C++ game engine and then try to transfer the models into that.

      My suggestion is to find an existing standalone game engine(Source, Unreal, Cryengine,...) and try to import SU models into that, I'm sure there are plenty of tutorials on that but I haven't done anything like it.

      posted in SketchyPhysics
      M
      Mr.K.1
    • 1 / 1