You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, rotating individual components in NGL (ctrl+shift+left-drag) rotates around their center, which is defined as the center of mass of the structure (or assembly). This can be confusing; try rotating the default view of 2c8n for example. The center is outside the visible structure altogether. I plan to add a pivot Vector3 field to Component, and account for that in rotation and scaling, so by setting the pivot we can set the center of rotation to be anywhere -- the visible center when there's a selection, for instance.
Once that's in we can discuss auto-setting the pivot point based on assembly or selection etc.
Thoughts? Seem like a good idea? Alternative proposals?
The text was updated successfully, but these errors were encountered:
Yes, very similar. Actually while investigating this I came across what I think is a bug: in component.ts:updateMatrix() it passes a temp vector to getCenterUntransformed(). That's the function that returns the center of the given component. That function takes any, but no derived class expects a vector there. Instead, structure-component.ts expects an optional selection string there, and if one is passed in, it returns the center of that selection (otherwise the center of the structure). No other derived classes expect any arg there.
So one way to do at least part of this is just to pass the selection through; it's a bit complicated because of the base/derived relation, but I have it working. This alone does allow for rotating around the center of the selection (a huge improvement already, for me at least) -- which shows that the math referred to in #777 is pretty much already there. It doesn't address the symmetry/assembly issue though. But it doesn't seem that hard to extend, so I'll keep working on it.
Right now, rotating individual components in NGL (ctrl+shift+left-drag) rotates around their center, which is defined as the center of mass of the structure (or assembly). This can be confusing; try rotating the default view of 2c8n for example. The center is outside the visible structure altogether. I plan to add a
pivot
Vector3 field to Component, and account for that in rotation and scaling, so by setting the pivot we can set the center of rotation to be anywhere -- the visible center when there's a selection, for instance.Once that's in we can discuss auto-setting the pivot point based on assembly or selection etc.
Thoughts? Seem like a good idea? Alternative proposals?
The text was updated successfully, but these errors were encountered: