Ngl: Custom Transformation Matrix

Created on 11 May 2017  路  4Comments  路  Source: nglviewer/ngl

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

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.

All 4 comments

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

strucs_matrix.tar.gz

thanks, just what I needed, added it, see https://codepen.io/arose/pen/pPVRxO?editors=0010

Thank you very much! Works beautifully

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josemduarte picture josemduarte  路  4Comments

thomashopf picture thomashopf  路  6Comments

stefdoerr picture stefdoerr  路  3Comments

harryjubb picture harryjubb  路  4Comments

sunhwan picture sunhwan  路  4Comments