Bladetrick Posted October 10, 2018 Share Posted October 10, 2018 hello! I have inherited a model that has several layers. Its a vehicle that is broken down into engine, body, exhaust, and break systems. Each component is a new mesh layer. As I was using babylon js to iterate through the layers of the model, I noticed that every mesh in the entire model has a position of (0, 0 , 0). Is this normal? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2018 Share Posted October 10, 2018 Well why not? the position can be zero and all the information is stored per vertex Bladetrick 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 11, 2018 Share Posted October 11, 2018 haha. That sounds SO goofy, but true. I guess... what? Slowly rotate each mesh, and it's easier to see offset-distances of vert positions... from mesh 0,0,0 origin. Likely, the point-of-pivot will NOT be in the center of the actual mesh-"volume" (on certain layer-mesh). I think there is a way to set the mesh origin to a more bounding-box-centered position. Some setPivotPoint or setPivotMatrix BJS feature. Here, I found this, somewhere: mesh.setPivotMatrix(BABYLON.Matrix.Identity()); mesh.makeGeometryUnique(); mesh.setPivotPoint(mesh.getBoundingInfo().boundingBox.centerWorld, BABYLON.Space.WORLD); I dunno what that stuff does, but it's fun to experiment-with. I hear makeGeometryUnique() ensures that pivot point changes happen on THIS mesh only, and NOT its parent. Clones are also involved, and possibly instances. Forum search for 'makeGeometryUnique' == good idea. Ok, that's enough Wingnut interrupting/yammering for THIS post. Party on! GameMonetize and Bladetrick 2 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.