I have done similar experiments with #unity3d and PlayCanvas, without spending too much time on it though
Models from OnShape are made of vectors, but polygonal models are needed to use on #3d engines.
I tried to export the robot as a whole, which is really much more handy than having a dozen of files to import, but my knowledge of 3D engines is too poor to figure how to work this out.
After some manual work, I was able to reconstruct the model in Blender, and then exported each moving part to a single collada file.
I define a moving part any combination of motor and 3D part that is constrained altogether.
For instance, part 6 is the part composed of the lampshade and the last motor, minus its rotating part (which is bound to part 5).
Anyway, I tried 2 different export approaches:
- Export each part with its rotating center as the world (0,0,0).
- Export each part with its rotating center properly set (= manually).
The first one is much more direct, but the second one ensure each part can rotate on its own origin.
To avoid the pain of doing it by yourself, I made a Blender file for each approach. This should be enough to be exported in any kind of software of your own.
The archive is available on Dropbox.
For me, it worked rather correctly, but I had several problems binding parts together. I ended up making part 6 a child of part 5 that is a child of part 4 that is a child of… you figure the following.
This ensures parts move altogether, but I feel something is wrong in this approach. I’d rather have some kind of infinite force to bind each part to its nearest ones, just like the rivets are doing.
Again, I could not manage to find how to do this easily.
There is also one thing you should know of: materials density and weights are considered unknown. I’ve done everything considering all parts had the same weight, except for the base which had to remain stable.
This is pretty much wrong, and applied forces will not be accurate at all, leading to weird physics.
The URDF file contains information about mass, and I think it could be parsed using the ros collada_urdf plugin to make it all work, though I’m not a ros expert enough to accurately tell you.