Myjestic Posted February 2, 2017 Share Posted February 2, 2017 Hi, I exported the following model as babylon file: https://clara.io/view/3bd34d7b-11cf-4077-9d34-eb242c0c4763 I want to rotate the question mark around it's own axis. Here is how I do it: BABYLON.SceneLoader.ImportMesh("", "meshes/", "QM.babylon", scene, function (newMeshes, particleSystems, skeletons) { newMeshes[0].position.x = -26.2; newMeshes[0].position.y = 2; newMeshes[0].position.z = -23.8; newMeshes[0].scaling = new BABYLON.Vector3(5, 5, 5); scene.registerBeforeRender(function () { scene.getMeshByName("QuestionMark").rotation.y += 0.05; }); scene.debugLayer.show(); }); The problem is, that the rotation axis is not in the middle of the question mark. I tried to transform the model in clara.io with translation on x-axis. But translations have no effect in my babylon scene. Who can help? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted February 2, 2017 Share Posted February 2, 2017 i think its the same thing Quote Link to comment Share on other sites More sharing options...
Myjestic Posted February 2, 2017 Author Share Posted February 2, 2017 This problem is similar but unfortunately not the same. If you take a look at the question mark model you can see the offset from the origin. You have to center the pivot and everthing works great in clara.io. After export to babylon file the pivot values are missing. Quote Yes, in Blender you got a function: Apply Rotation Apply Scale. So the position(s), rotation(s), transformations etc. will be zeroed and handel as the initial value for a mesh and then exported correctly. you have to look for it in 3D Max. I have found the clara.io function "Bake Transform". But unfortunately it does not work. After export nothing is baked. I think, this a problem for the clara.io forum. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted February 3, 2017 Share Posted February 3, 2017 @Myjestic So its just a note, not a fix: Model downloaded here: https://www.models-resource.com/gamecube/sonicadventuredxdirectorscut/model/253/ 3DS -> in Blender: Means if you have an ArcRotateCam in your scene it points at 0,0,0 and if you apply rotation to a model it will rotate around this point (i not sure about this)@gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted February 3, 2017 Share Posted February 3, 2017 Well @Myjestic ; I took a look at the models from @Nabroski's link and used the .obj for this comment. In the image below (A) you will see the the unmodified mesh - note where the question mark is, and where its origin (the origin dot) is. When you rotate you will be rotating about the origin! Now you state above: 11 hours ago, Myjestic said: I want to rotate the question mark around it's own axis Its axis is not inside its mesh geometry and just moving the mesh (clara.io) will not bring the origin (its axis) to the geometry. I have modified the file (B below) so the origin is at the base of the mesh so it should rotate happily on the Y axis in BJS. ( I also applied the rotation to the mesh.) I have attached the .babylon file below - see if this is what you are after. cheers, gryff question1.babylon Quote Link to comment Share on other sites More sharing options...
Myjestic Posted February 3, 2017 Author Share Posted February 3, 2017 @gryff This is exectly the problem I have. Everthing works like a charme if the origin is in the center of the model. You did it with a another tool. In clara.io you can move the origin to the center of the model and then "Bake Transform". This will put all coodinates together. But after export, this information is lost. So I would say I give it a try in the clara.io forum, maybe someone knows the problem with this "bake thing" and export to babylon.js. Nonetheless, thanks for "adjusting" the model for my needs 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.