How To Set The View From A Particular Angle (Plane) In Pymol?
2
2
Entering edit mode
13.1 years ago
Pedrosaurio ▴ 90

Is there a way of selecting a particular position from the camera? I want to set 3 views: top, side and front. In other words, one view per plane: XY, YZ and XZ.

I tried using rotate or turn but the angle you can set for the rotation is not absolute to the space.

pymol • 6.2k views
ADD COMMENT
3
Entering edit mode
13.1 years ago

You can use set_view to set up a viewing matrix (cf. here for the rotation part).

If you don't know the theory behind matrix transformation, then using get_view, rotate, and set_view together might be easier than constructing the matrix yourself.

ADD COMMENT
0
Entering edit mode

Thanks I'll learn the theory and give it a go.

ADD REPLY
0
Entering edit mode
13.1 years ago

You can use quaternions. It is a quite difficult when you start to use it but it is very useful.

Here I paste some lines from one code I made some time ago. I hope it help you.

What I do is to add some lines to a pymol script. Basically I trace a vector from the c-terminal to the n-terminal and align this vector with one of the axis of the screen.

There is more help in the web if you search for quaternion use.


system 'echo q = quaternion\\(script\\(\"show rotation\"\\)\\) >>'." $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo toAtom = {$Length.CA}.xyz - {1.CA}.xyz  >> $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo toUser = \\(!q\\)\%{1 0 0}  >> $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo axis = cross\\(toAtom, toUser\\) >> $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo a = angle\\(toAtom, {0 0 0}, axis, toUser\\) >> $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo rotate MOLECULAR {0 0 0} \@axis \@a >> $Pdb\_$Chain.pdb_cfrst.jmol";
system "echo center >> $Pdb\_$Chain.pdb_cfrst.jmol";

Best

ADD COMMENT
0
Entering edit mode

There's no need for quaternions here IMO. And yes, I do know what they are.

ADD REPLY

Login before adding your answer.

Traffic: 2847 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6