Thanks Jared,
I have tried the transformations.py script, and here is what I've got:
- I get a quaternions from external source (a 3d manipulator) in a
classical form: [x,y,z,w]
- I use function: quaternion_matrix(quaternion) from transformations.py
script:

m = quaternion_matrix([x, y, z, w])    # m is an array of an arrays (4x4)
M = [m[0,0], m[0,1], m[0,2], m[0,3], m[1,0], m[1,1], m[1,2], m[1,3],
m[2,0], m[2,1], m[2,2], m[2,3], m[3,0], m[3,1], m[3,2], m[3,3]]   # so i
need to convert it to a vector 16x1
cmd.transform_selection("all", M, homogenous=1)  # its time to apply the
vector into a transform_selection function; homogenous=0 also doesn't work
print M # print works fine ;)

But the function transform_selection does not work and I don't really know
why, rotation doesn't occur.
Maybe it's because the selection is wrong? On the scene I have a CGO (an
arrow) and even when I change the selection string from "all" to "arrow" it
doesn't rotate either.
What exactly is the "selection", could this be a CGO?

I have also noticed, that function cmd.rotate(...) works for my CGO "arrow"
when I set property object="arrow" and I put some arbitrary "hardcoded"
parameters (axis and angle).
Maybe the better way would be use this function?
But I'm not really sure which function from transformations.py script
should I use to convert quaternions to axis and angle params required by
cmd.rotate() function...
any ideas?

Cheers,
Pawel T.





2015-08-13 18:34 GMT+02:00 Sampson, Jared <jared.samp...@nyumc.org>:

> Hi Paweł -
>
> Honestly, if you prefer to use matrices, I'd say just go ahead and use
> get_object_matrix; I doubt it's going away any time soon.  You may want to
> use this in combination with transform_selection
> <http://www.pymolwiki.org/index.php/Transform_selection>.
>
> Also maybe check out Christoph Gohlke's transformations.py script
> <http://www.pymolwiki.org/index.php/Transformations>.  It offers several
> tools for manipulating quaternions, matrices, and angle/axis operations.  I
> think there's also a newer version on his website, which is linked from the
> wiki page.
>
> Cheers,
> Jared
>
> --
> Jared Sampson
> Xiangpeng Kong Lab
> NYU Langone Medical Center
> http://kong.med.nyu.edu/
>
>
>
>
>
>
> On Aug 6, 2015, at 4:04 AM, Paweł Tomaszewski <croov...@gmail.com> wrote:
>
> Hello,
> I've created a CGO in pymol script (a cone) and I need to make some
> transformations on it. I've found that it is easier for me to modify a TTT
> matrix rather than using translate/rotate functions.
>
> Documentation says [http://www.pymolwiki.org/index.php/Get_object_matrix]
> get_object_matrix is unsupported operation. So how to get/set TTT?
>
> The problem is, that I get (from external source) position in quaternions
> and now I need to make my CGO position equal to those quaternion. How can I
> make it work?
>
> Thanks
> Paweł Tomaszewski
>
> ------------------------------------------------------------------------------
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>
>
>
> ------------------------------------------------------------
> This email message, including any attachments, is for the sole use of the
> intended recipient(s) and may contain information that is proprietary,
> confidential, and exempt from disclosure under applicable law. Any
> unauthorized review, use, disclosure, or distribution is prohibited. If you
> have received this email in error please notify the sender by return email
> and delete the original message. Please note, the recipient should check
> this email and any attachments for the presence of viruses. The
> organization accepts no liability for any damage caused by any virus
> transmitted by this email.
> =================================
>
------------------------------------------------------------------------------
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to