0

I'm currently facing a problem with WPF 3D using C#. To put it simple, I need to animate some simple mechanical part by only moving two of them (one at a time or both together). Here is a simple drawing depicting the situation :

sketch

So by moving (translating) vertically P1 or/and P2 parts, the whole thing needs to move accordingly.

I guess it may be possible to do by computing a lot of angles and applying numerous transformations but this is not my goal.

Therefore I would imagine something like attaching the parts together by the means of a pivot point.

What is the preferred way to do this to preview it using WPF 3D?

cid
  • 696
  • 1
  • 8
  • 19

2 Answers2

3

WPF 3D, Ogre, Mogre, OpenTK... are libraries for display. They have nothing to do with mechanical constraints calculations. But they goes well with physics engines.

WPF 3D is a subset of WPF dedicated to 3D drawing. If you need 2D, then WPF is enough.

As your project looks 2D, you might want to have a look to Farseer Physics which is a port of Box 2D. The feature you need is called joints. Both libraries target 2D games development, but they can be used for simple kinematics animations, and Farseer Physics is doing very well with WPF.

Larry
  • 17,605
  • 9
  • 77
  • 106
  • Hey this one looks nice. I also have found [BEPU Physics](http://bepuphysics.codeplex.com), and I forgot the famous [ODE](http://en.wikipedia.org/wiki/Open_Dynamics_Engine). There are a lot of physics engines that can be used in .NET. – Larry Mar 06 '14 at 19:35
  • Thanks guys for the help, I'll take a look soon! Still, I'm wondering something. Given the fact that I'm doing 3D drawing (not 2D) and also that I'd like to avoid as much as possible the use of external libs, is this _kinematics_ problem feasible by hand? – cid Mar 06 '14 at 22:55
  • I am sorry I am not experienced enough to answer this. However, if you are trying to avoid the use of external libs, you can have a look on things which are done in well-known open source physics engine, and grab the code you need. Also, @duffymo's answer link can help. – Larry Mar 07 '14 at 21:15