Good idea. I though of doing that but then forgot.
Posts
-
RE: Pre-release SP 3.2 (test of midi support)
-
RE: SketchyPhysics3.1
Yeah 3.2 should work on Mac. I'll do a zip file for it tonight.
-
Pre-release SP 3.2 (test of midi support)
What little time I have had for SP lately I spent working on a model. It is inspired by this video:
http://www.youtube.com/watch?v=hyCIpKAIFyoIn order to make it work I had to add a few new features to SP (hey its good to be the author).
First I tried using the new sound embedding to make a set of instruments. I soon realized that to make it work it would take a huge amount of .wav samples (one for each note or drum) and that made the file way too big. So I started to look at Midi.
Turns out Win and Mac both support Midi instrument playback and there are huge number of built in instruments samples plus a nice collection of sound effects.
And because the midi notes are on/off and velocity based it suites itself well to SP physics ontouch/onuntouch events.
After I got it working (with a lot of help from Kevin) I did the attached drum set.
It works. But depending on your setup it probably sounds like the drummer is on speed or ludes and drunk in the bargain. The beat of the drums is totally dependent on the frame rate.
After some thought I decided to try a piano next. After some work I managed to fix most of the timing problems. Check out the piano example. I its really cool! And I think I know how to make the percussion instruments work now.
It would be easy to fake it and play a note then move a finger. But its done right and the note plays only when a finger touches a key. That involves calculating the delay in the servo and adjusting the score accordingly.
If this version and the demos work for everyone I will clean up the interfaces and a proper 3.2 release.
Chris
Here are the changes since the last version:
Changes in version 3.2
- Added midi note support.
- New user events system. Script commands "on" and "signal"
- Wacovs hud code. script commands draw,draw2d,draw3d and view accessor.
- joint.controllerValue now works with motors and gyros
- New script command setFrameRate overrides physics settings framerate.
- Added script command setSoundPosition(sound,position,volume=5.0) Allows 3d audio when called once per tick.
Bugs fixed:
- Fixed a Mac SDL sound crash (thanks Kevin!)
- Fixed sounds not stopping at end of simulation
- Fixed bug where solids would drop into floor first time you run.
- Bug fix. Scripted flag wasnt being observed at runtime.
Other:
Removed a lot of debug spam. Added a little.
-
RE: SketchyPhysics3.1
setVelocity takes a vector that is the direction the object will be moving and the length of the vector is how fast. It is different from push because it actually sets the objects velocity rather than just try to push it.
setTorque does the same thing with the objects rotation.
I updated the script page on the wiki.
Example attached
-
RE: SketchyPhysics3.1
I have the updated Mac files now and will release a new version in a few days.
Thanks Kevin!!
-
RE: SketchyPhysics3.1
Ah, i forgot about the motor joint. Ill fix in next version.
-
RE: Frame Rate, Gravity, and World Scale
I am afraid that isn't right. Think of it this way. 1 is slow mo, 3 is normal speed and 6+ is fast forward.
The framerate is the number of physics steps that happen before Sketchup displays the frame. A physics step is 1/60 of a second. The default is actually 3 and with it goes like this
Advance physics simulation by 1/60 sec.
Advance physics simulation by 1/60 sec.
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
Advance physics simulation by 1/60 sec.
Advance physics simulation by 1/60 sec.
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
etc.if the framerate is 1
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
Advance physics simulation by 1/60 sec.
Update Sketchup object positions.
etc.Here is where it gets a bit tricky. By far the slowest part of this cycle is the Update Sketchup Object part. That means that the lower the framerate the slower the model appears to run even tho its actually running at the same speed as if you were using 3. With 3 you will just get more simulation time in the same number of real time seconds.
Hope that helps.
Chris -
RE: SketchyPhysics3.1
New version is up here:
http://code.google.com/p/sketchyphysics/downloads/listChanges:
http://code.google.com/p/sketchyphysics/wiki/SP31Oct7Once a few people verify it works I'll turn on the auto update feature.
Update:
I have enabled the autoupdate. Hopefully it works. Some of the first few people who downloaded may have to update again as I forgot to change the version. -
RE: SketchyPhysics3.1
Updated the scripting reference. Not done yet, but more usable now.
-
RE: SketchyPhysics3.1
@cphillips said:
@jblively said:
I'll never draw another dang joint again if this works
Thats a bit harder than it sounds. But I will look into it.
Ah! Turns out to be easier than I thought. This will work in next version:
!!!Example only. Will not work in Sept 27 version!!! ontouch{|t,s,p| @jnt=connect(t,"servo",0,90) ontouch{} } ontick{ if @jnt!=nil @jnt.controllerValue=slider("position") end }
-
RE: SketchyPhysics3.1
@jblively said:
On the self Connecting Joints Example, can you add a name of a slider in there, so there can be a way to control the joints via the control panel?
ontouch{|t,s,p|
connect(t,"servo")
ontouch{}
}I didn't see it in this Definition: connect(child,type="ball",min=0,max=0,accel=0,damp=0,breakingForce=0)
I'll never draw another dang joint again if this works
Thats a bit harder than it sounds. But I will look into it.
-
RE: SketchyPhysics3.1
Turns out the break example will bugsplat SU8. I have a fix but I am going to wait and see if there are any other issues before I release a new version.
-
[plugin]SketchyPhysics3.1 (Updated Oct 7)
SketchyPhysics3.1 is out. Should be more stable with SU8.
http://forums.sketchucation.com/viewtopic.php?f=61&t=31262
Posted a new version Oct 7. This version includes Mac support.
-
RE: SketchyPhysics3.1
Here are some older examples that now work in this official release version.
http://forums.sketchucation.com/viewtopic.php?f=61&t=20209&start=0#p168251
http://forums.sketchucation.com/viewtopic.php?f=61&t=20209&start=0#p168253
http://forums.sketchucation.com/viewtopic.php?f=61&t=20209&start=0#p168254
http://forums.sketchucation.com/viewtopic.php?f=61&t=20209&start=0#p168265 -
RE: SketchyPhysics3.1
This example shows off several features. Embedded sounds, destroying bodies during simulation, logging messages to the screen, camera following a target and lots of ontouch features.
-
RE: SketchyPhysics3.1
Another curve example. This time the curve is used to set the position (via controller field) of a pair of pistons.
-
RE: SketchyPhysics3.1
Here is an example of something I just added recently. A script function that allows you to get a point along a Sketchup curve. It can be used for any number of things. In this case I use it to move bodies along a curve.
-
RE: SketchyPhysics3.1
Yes it will run under SU7. Just change the location its installed to.