alcos Posted October 26, 2016 Share Posted October 26, 2016 Hello everyone, http://babylonjs-playground.com/#RZGEH#0 In the example above, on the left should be exactly what's on the right. But, the mesh should stay in place, I don't want to change its position to compensate for the new pivot point. ajustPosition bellow should be 0. var offsetUnit=2; var ajustPosition=offsetUnit; var box1 = BABYLON.Mesh.CreateBox("box1", 2, scene); box1.position.z = -2+ajustPosition; box1.setPivotMatrix(BABYLON.Matrix.Translation(0, 0, -offsetUnit)); How to set the pivot point and keeping the mesh in place without changing its position? Quote Link to comment Share on other sites More sharing options...
adam Posted October 27, 2016 Share Posted October 27, 2016 I don't understand why you needed adjustPosition. http://babylonjs-playground.com/#RZGEH#1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted October 27, 2016 Share Posted October 27, 2016 yeahhttp://babylonjs-playground.com/#RZGEH#2 Quote Link to comment Share on other sites More sharing options...
alcos Posted October 28, 2016 Author Share Posted October 28, 2016 21 hours ago, adam said: I don't understand why you needed adjustPosition. Because setting the pivot is moving the mesh like you can see on the right side here: http://babylonjs-playground.com/#RZGEH#3 (I would like to rotate around the second sphere by only changing the pivot). I was wondering if it is possible to set the pivot but the mesh to remain in the same position. Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 28, 2016 Share Posted October 28, 2016 Is this closer to what you need ? http://babylonjs-playground.com/#RZGEH#4 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.