I think there should be a better way without resetting the rotation and scaling.
investigatingā¦ (thanks for your patience)
Yes, but doesnāt this sound all a bit complicated to you Guys? May be should find a way to record and keep/freeze the mesh position while dragging the pivot to another position? Just a thought of mineā¦ What are your thoughts?
Thatās what I did by caching and maintaining the absolute position in the PG I postedā¦ And I also tried my other idea of baking you quoted but it didnāt work and got edited out.
I know you did. Not what Iām saying and (on behalf of the poster) thx for your efforts.
Itās just that we have been struggling with this for a while (when I say āWeā, itās actually mostly @JohnK and I believe he knows his business so since this has been going on for a while, there might be something (just something) to be done/improved in the method of how we parent (and eventually delay) to a new pivot?
Edit: I hope I am not offending anyone with my broken english, am I? It just feels to me that some sort of improvement could may be be found for the method. Not speaking about the contribution of you Guys trying to find a solution. I hope this is clear for everyone. Meanwhile, have a great day
why not using a parent instead of a pivot here ? so you could rely on setParent which does the job for you ?
Also hereās a way to maintain the position and rotation when changing the pivot point. Although Iām not for sure I think itās what youāre afterā¦
Thank you for your answer,the result of setting the axis point should be wrong,by commenting on the 50th line of code, you can find that the axis point is not set correctly.
I tried commenting out line 50 like you said but it seems to be working as far as I can tell. Maybe you could explain more which parts arenāt working how you want and how you would want it to work?
Hmm, if call setPivotPoint like below then is it rotating how you wanted?
Okay, my English is not good, I try to express it clearly.
There are 2 functions in my project that need to modify the pivot point.
- Objects in the scene may be bound with multiple animations. The pivot point needs to be switched between each animation. The position of the object cannot be changed when switching.
- Based on Babylonjs RotationGizmo, I developed a gizmo tool that rotates multiple objects together. When I select multiple objects, the gizmo position is in the center of the bounding box of multiple objects. When rotating, it rotates around this center. At the end, it is necessary to To restore the center of rotation, I modified the center of rotation by modifying the pivot point, but it doesnāt seem to work at the moment.Like this,
It doesnāt work when restoring the axis point, it should be something I wrote wrong
Actually it looks like when changing the pivot to the identity matrix then can just cache and set the absolute position like in the second time out below.
Thanks, this is the best solution for me so far.
Best wishes