Matlab integration of Sketchy physics
-
Hi Phil,
I still want to be using sketchy physics while I am doing that.I want to integrate to matlab and still program and change parameters like mass,coefficient of friction etc..It is like matlab interacts with google sketch up models via the sketchy physics.Could you please suggest me how to do this? -
Also philips, there is one more physics engine called Open Dynamics Engine which is used more in research.It would have been great if you would have developed sketchy physics on this or also made one using this.So that even academic research people who have used ODE (which does not have GUI)could use it now flexibly with google sketchup.Thus benefiting both.
-
As I said before I have no experience with Matlab and as such have no idea how to go about integrating it or even if it is possible. Also SP currently does not expose mass and friction. The physics engine supports it via "material" pairs, but the interface isn't easy to translate in to Sketchup terms.
As for ODE, when I started SP I looked at all the physics engines that were then available and chose Newton mostly because of the joint implementation. If I had it to do all over I might go with ODE or Physx but it is too late now.
Sorry
Chris -
I think I am on my own now.But could you help me extend the same physics plugin idea to ODE.In ODE also there are several joints available.
http://www.ode.org/joints.pdfAnd ODE was available since 2002.Now ODE has more features than the Newtons SDK.If Newton had the facility of setting parameters like mass and coefficient of friction,etc it would be great.Also ODE uses OpenGl.Could you please guide me about how to integrate it.
And ODE has a better documentation http://www.ode.org/ode-latest-userguide.html
-
Newton supports mass and friction I just haven't exposed it to SP yet. I plan that for the next major version. And I have nothing against ODE. As I said if I had to do it over I might do it differently.
If you want to make a ODE plugin for Sketchup I can offer advice and encouragement but I dont have any spare bandwidth to spend on coding. Here is an overview of whats involved.
The first step is to link ODE to the Ruby language that SU uses for plugins. I use Ruby/DL to link to the Newton.dll. Then at runtime initialize the physics engine and then traverse the model and create physical bodies and joints for each group tagged as a physics object. Then you can use the Sketchups Tool class to wrap animation of the physics engine (the "nextFrame" calls). After each frame readback the location of all the objects in the simulation and set the groups transformation accordingly.
Its not too hard to do but the devil is in the details. For example under Newton the bodies need to be scaled and rotated into the coord system of the physics engine. But I expect ODE being more widely used will have fewer problems like this.
Chris
-
Just was looking at PhysX.I think it was owned by Ageia and now by NVDIA.It looks better than Newton SDK (just looked at some demo videos).But I am not aware of it features like mass,cofefficient of friction etc..do you have any idea?
-
Pretty much any physics engine is going to support that.
-
I think if I write the plugin for another physics engine ,I would be reinventing the wheel ,atleast a part of it.If Newton SDK would also develop into newer version and improve like Sketchy Physics ,it would be great.I am not as capable as you in terms of programming.I will have to learn how to write Ruby plugins first.But an Idea is to combine a mathemetical computation software like Octave it might be good.Though it may not match Matlab but it would be great for academic purpose.
Link to Octave :
http://wiki.octave.org/Parallely at one point of time in the future if you would give Mass and coefficient of friction support it would improve as a physics analysis software.Also there are open source FEA solvers which analyze the model dynamically taking it as a mesh.
Also develop more features like force vectors,RPM for motor etc.
-
Mass and friction are coming in the next major version. Some force type stuff is coming in the next minor version. I dont know anything about FEA solvers but I will look it up.
I should point out that my first goal with this version was a game type simulation and not something scientifically accurate. It probably could be but that hasn't been the focus.
-
@unknownuser said:
I should point out that my first goal with this version was a game type simulation and not something scientifically accurate. It probably could be but that hasn't been the focus.
I remember reading somewhere that Google's intent on acquiring Keyhole was for gaming platforms. Last time I checked I think people are doing a lot more with GE than just gaming. And don't even get me started on Velcro.
Cool stuff....I am now off in the Octave world as well but mostly waiting for the latest improvements to SP.
-
Well since googles products are mostly innovative,simple and based on intuition their products work like awesome.One thing which most of the physics engine don't do is: Say in a physics engine I make body move over a surface from point A to Point B with just a simple command "Move body M from point A(x1,y1,z1) to B(x2,y2,z2).But there isn't a feature which dynamically shows the free body diagram of the body with the forces working on it.Phiilips,if one can incorporate such a feature where in the force vectors are indicated by a solid translucent arrow whose orientation and length shows the forces acting on the body qualitatively then it would improve the visualization of the physics happening in there and this would also help the person better study the model.I feel it would be simply awesome
Advertisement