I wrote a pymol plugin that produces a bunch of cgo. The images I generate
have a cube drawn around them.

I've been asked if it's possible to allow the user to initially rotate the
image to their heart's content and then have the plugin draw the
surrounding cube. I.e., once the image is rotated, the cube will be drawn
in a way that always looks good to the viewer, not at some random angle. In
other words, the cube will always have the same orientation, no matter how
much the image has been rotated before the cube is drawn.

OK, having said the same thing 3 times, and hopefully made sense at least
once, I'll say something new...

I imagine this can be done easily enough. I guess I should be able to call
get_view and get the current rotation matrix (elements 0-8 of the returned
list) and apply this to all points that I plan to draw between when making
the cube.

My questions: Is this right? Do I need to do anything more than just
multiply the old point by the rotation matrix? What's the easiest way to do
this in Pymol or Python, or should I just code it (it's very simple after
all).  And, of course, is there a better way to do what I want?

Thanks for any help. Don't assume I know what I'm doing, because I probably
don't. So the more details, the better.

Regards,
Terry

Reply via email to