Hello,
first of all thanks for the development of NGL, i like it a lot compared to other available web viewers.
Currently i have a problem to implement my own transformation matrix to superpose two molecules (like the pymol transform_object() command would do). It is important to use the already calculated matrices, so the superpose() function of NGL is not really an option for me.
Is there some clever way to do this, which i may have missed, or would i have to write my own function?
greetings
Perfect timing :)
I just added a transformation matrix to the component class, see https://codepen.io/arose/pen/XREVaK?editors=0010.
For your use case I would need to add a new api method setTransform( Matrix4 ) as the current .setRotation( Quaternion ) uses the center of the component as the center-of-rotation.
Could you provide my with an example? That is two structure files and a transformation matrix. Thank you.
Wow what a timing. Thank you very much!
I appended 2 structures as well as the 4x4 matrix. I also added the pymol script that uses the matrix.
Greetings
thanks, just what I needed, added it, see https://codepen.io/arose/pen/pPVRxO?editors=0010
Thank you very much! Works beautifully
Most helpful comment
Perfect timing :)
I just added a transformation matrix to the component class, see https://codepen.io/arose/pen/XREVaK?editors=0010.
For your use case I would need to add a new api method
setTransform( Matrix4 )as the current.setRotation( Quaternion )uses the center of the component as the center-of-rotation.Could you provide my with an example? That is two structure files and a transformation matrix. Thank you.