Art Vandelay Posted January 2, 2018 Share Posted January 2, 2018 Hi, I noticed that when I load a mesh at a certain position, the bottom center of the mesh will be at that position. For example, If I create a ground and then load a mesh at (0,0,0) then the mesh will be on the ground. So the actual center of the mesh is above the ground. How can I change the center of the mesh so that, for example, its actual center appears at (0,0,0)? Is there some sort of offset I can add? I hope the question makes sense. Thanks! Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 2, 2018 Share Posted January 2, 2018 Pivots may help Amarth2Estel and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted January 2, 2018 Share Posted January 2, 2018 Hi ! What do you mean by "loading a mesh" ? If you are actually importing a mesh (such as an .OBJ file) then its pivot is already given. You can change the pivot of your mesh by editing your 3D model in Blender/3DS Max etc.. and exports it again. Moreover, in BJS, you can directly manipulate Pivot of a mesh. https://doc.babylonjs.com/how_to/pivots Playing with Pivot and BoundingBox data to get actual center (so, the "offset") of your mesh should be enough to reach your goal ! Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted January 2, 2018 Share Posted January 2, 2018 Ow. Too slow. JohnK was way faster ! Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted January 3, 2018 Author Share Posted January 3, 2018 Thanks guys! Just what I needed. 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.