hit2501 Posted July 1, 2018 Share Posted July 1, 2018 Hi, I wonder if this is posible but dynamically in Babylon instead Blender: I can change the size of a mesh with some sliders and .scaling but this only works starting from the origin point. I tried Pivot Point but this seems to work the first time and then the mesh changes location (to pivot point) and the scaling continues working taking the new central point. Also I can find the coordinates for each vertex but I dont know how to move the origin point to that vertex. Is there any way to change the origin point to be able to scale starting from that point? Thank you. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 2, 2018 Share Posted July 2, 2018 You can set the Pivot Point in BabylonJS with the pivot matrix, but there are two methods, so good to know the difference: mesh.setPivotMatrix(pivotMatrix) mesh.setPreTransformMatrix(preTransformMatrix) Otherwise maybe you can export your model and we can work together on a Playground. Here I'm just changing scaling and it is making the mesh scale the same as your video with a blender origin: https://www.babylonjs-playground.com/#AVXVIQ#2 hit2501 and Wingnut 1 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 2, 2018 Share Posted July 2, 2018 12 hours ago, hit2501 said: I tried Pivot Point but this seems to work the first time and then the mesh changes location (to pivot point) and the scaling continues working taking the new central point. This behaviour depends on the version of babylon.js you are using see https://doc.babylonjs.com/how_to/pivots#breaking-change hit2501 1 Quote Link to comment Share on other sites More sharing options...
adam Posted July 2, 2018 Share Posted July 2, 2018 There is also setPivotPoint. https://doc.babylonjs.com/how_to/pivots#how-to-set-and-get-a-pivot-point edit: Maybe you tried it already. 13 hours ago, hit2501 said: I tried Pivot Point but this seems to work the first time and then the mesh changes location (to pivot point) and the scaling continues working taking the new central point. hit2501 1 Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 2, 2018 Share Posted July 2, 2018 @hit2501 You can also make the mesh a child of another mesh. The advantage of this is that your pivot point can also be dynamically animated along with the child mesh. But this doesn't work for all scenarios. DB hit2501 1 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted July 7, 2018 Author Share Posted July 7, 2018 Thank you brianzinn, I could apply your demo but I still must to study it to understand better, if I have questions, may I ask you? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 7, 2018 Share Posted July 7, 2018 Yes for sure. I'm following this thread now, so will get an email when you post. edit: As JohnK mentioned - my playground demo assumes a version of BabylonJS >= 3.2, so keep that in mind. 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.