joshcamas Posted October 31, 2014 Share Posted October 31, 2014 Ello guys! I'm in dire need to set a origin of a mesh to something other than it's original values! This is to make it rotate at a specific spot. :3 Anyone know how to do this? I know there is "setPivotMatrix", but don't know how that workses. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 31, 2014 Share Posted October 31, 2014 You can create an empty object, then attach this to a mesh by adjusting its position. so when you move the points, the mesh will follow. var EmptyPivot = new BABYLON.Mesh("pivos", scene); MyMesh.parent = EmptyPivot; EmptyPivot.position.y = 5.0; and for setPivotMatrix, I think that's the way it is used : var matrix = new BABYLON.Matrix.TranslationToRef(0, 5, 0, MyMesh.getPivotMatrix()); MyMesh.setPivotMatrix(matrix); webdva and JackFalcon 2 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted October 31, 2014 Author Share Posted October 31, 2014 Oh! Thank you! This is perfect 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.