Zim Posted November 8, 2018 Share Posted November 8, 2018 Hello everyone! I've been strugoogling with the following behavior I get importing a Blender model into Babylon, which it is still about importing a LDraw model (see my previous and first thread), and I still don't know whether it's a problem with Blender, BJS or Cannon.js. In Blender, on my imported LDraw vehicle model, I set an origin on each geometrical wheel center in order to be able to make them rotate along the x axis (when the vehicle is moving forward or backwards) and along the y axis (for the steering). Then, I create a wired cube with the same origin as the origin of all the vehicle parts (except the wheels which has been changed) - which roughly corresponds to the geometric center of the vehicle. This cube is meant to be the vehicle's bounding box. So I resize it to fit the vehicle, and make all other parts children of it. On load in BJS, I set the cube's visibility to false, set a BoxImpostor on it, and everything look fine: the vehicle is visible and stays successfully on the ground. The problem is when pressing the directional controls to make the wheels rotate, they become squeezed (they are no more "round" (oval section instead of circular section)). I noticed that when the wheel are squeezed (when they are set a rotation value along any axis), their bounding box actually get the shape of the vehicle bounding box (which is the parent of every meshes). Consequently, when I create a cubic instead of a cuboid vehicle bounding box in Blender (the surplus volume being put above the vehicle), the wheels behave as expected and run smoothly (but the vehicle bounding box is far too big!) Does anyone know what is happening? Is it an expected behavior and the mistake is mine? Any help will be greatly appreciated! Kind regards, Zim Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 8, 2018 Share Posted November 8, 2018 No clue what this is. A submesh is when you have multiple materials on a single mesh. If Mesh.Merge does that now, think it must be downstream of export. Quote Link to comment Share on other sites More sharing options...
Zim Posted November 8, 2018 Author Share Posted November 8, 2018 My mistake, I haven't already familiarized myself with the 3D modelling vocabulary. Wheels are subparts (children) of the bounding box objet. But there are only two depth levels (the parent box and all the vehicle parts which are its children). Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2018 Share Posted November 9, 2018 I know little about collisions, but for reference, this is how it is supported in Blender exporter. When you select a mesh the last property tag, physics, needs some stuff. Rigid Body must be checked, then one of the imposter shapes must be checked (Box, sphere, mesh, Capsule, Cone, cylinder, or Convex Hull). Maybe try 'mesh'. This probably does not solve whatever your problem is, but at least now you know that you can actually put the imposter into the .babylon file. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 10, 2018 Share Posted November 10, 2018 I also made a screen shot, which I forgot to add to post from before: Quote Link to comment Share on other sites More sharing options...
Zim Posted November 11, 2018 Author Share Posted November 11, 2018 Hi JC, thanks for the tip and your time making a screenshot ! Unfortunately, it does not solve my problem. As an alternative to the cubic bounding box, using empty axes as parent also works (wheels keep their shape), but it cannot apply physics to it. Since modelling a car with animated wheels is something essentially common, there are probably good practices that I could refer to, if you know any? I find out this futuristic car which behaves as expected, but I can't figure out what differed in the modelling process. I wish the author made time-lapse videos rather than WIP... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.