From djsamperi at gmail.com  Thu Apr 17 19:56:22 2014
From: djsamperi at gmail.com (Dominick Samperi)
Date: Thu, 17 Apr 2014 13:56:22 -0400
Subject: [Rd] rgl rotations
Message-ID: <CADUbQ5jzOxftsVGLw-C-V4NSuk1uKM9p2PuQDigK3Xpm2L5gTA@mail.gmail.com>

Is there a way to change the viewpoint using view3d (or rgl.viewpoint)
with respect to
the image that currently appears rather than the perspective that rgl
thinks is the
default? For example, if I create an image and then perform what
should be a no-op:

rgl.viewpoint(userMatrix=rotationMatrix(0,1,0,0))

the image is rotated. Then I can perform rotations on the result
without surprises.
But I want to specify rotation with respect to the image as it
originally appeared,
or with respect to the viewpoint that is currently in effect.

Experimentation has revealed that when using rotationMatrix the z-axis
points out
of the canvas instead of pointing up as it often is in mathematics,
especially when
using the spherical coordinates (theta,phi).

I guess the question is: can we query rgl for the current viewpoint and then
apply changes to that? Another way of putting it is: can we do programmatically
what we can easily do using the mouse in interactive mode?

Thanks,
Dominick



[Rd] rgl rotations
Dominick Samperi