renjianfeng Posted August 21, 2017 Share Posted August 21, 2017 Hi ,When I use the Babylon file, which is exported by the 3dsmax exporter, some of the time, my model will have all sorts of weird problems. I list some problems, because of these features in 3 ds Max normal performance, Only in babylonjs will appear problem, Maybe I, informs it incorrectly, Only at some point will there be a problem, what is straightforward. 1.Some time, when I add parent to the mesh as a whole, the loaded model returns to the center of the scene. var groundMaterial = new BABYLON.StandardMaterial("groundMaterial", scene); groundMaterial.alpha = 0; var ground = BABYLON.Mesh.CreateGround("ground", 512, 512, 32, scene, false); ground.material = groundMaterial; for (var i = 0; i < scene.meshes.length; i++) { scene.meshes[i].position.y += 13; if (i < scene.meshes.length - 1) { scene.meshes[i].parent = ground; } } ground.scaling = new BABYLON.Vector3(0.1, 0.1, 0.1) Before using After using Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted August 21, 2017 Author Share Posted August 21, 2017 2.The position of the mesh is incorrect For example, the position of the door frame Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted August 21, 2017 Author Share Posted August 21, 2017 I need to know which default parameters need to be set in 3dsmax to avoid these problems,Please forgive me for my poor English. I have used some automatic translation tools. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted August 21, 2017 Share Posted August 21, 2017 Why do you need parenting meshes to the ground ? I'm not quite sure, but I think this code scene.meshes[i].position.y += 13; will reset all meshes Y position to 13, so of course all meshes will be moved, positioning their center pivot to Y=13 ; isn't it ? [edit ] no i get it, it add 13 to the value, so as to be up to the ground i suppose [/edit] GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted August 21, 2017 Share Posted August 21, 2017 Do you have clean your meshes in 3dsmax before exporting ? like reset transform & scale & xform ? It maybe be a solution. I have a maxscript to one-click this, save before using it ; when xform are applied, if your mesh is broken,it will explode and no ctrl Z is possible GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted August 22, 2017 Author Share Posted August 22, 2017 22 hours ago, V!nc3r said: Why do you need parenting meshes to the ground ? I'm not quite sure, but I think this code scene.meshes[i].position.y += 13; will reset all meshes Y position to 13, so of course all meshes will be moved, positioning their center pivot to Y=13 ; isn't it ? [edit ] no i get it, it add 13 to the value, so as to be up to the ground i suppose [/edit] I need to do a whole operation on all the mesh, like this: Ground. Scaling = new BABYLON. Vector3 (0.1, 0.1, 0.1) Rotation, scaling, position and so on That's why I got the meshes to the ground. Do you have a better way to do this? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 22, 2017 Share Posted August 22, 2017 Your model is not just one mesh but several. You will need to load a scene (with Load() or Append()) and not a mesh (with ImportMesh()). Then list each object in your scene to apply a scaling on them. GameMonetize 1 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.