Hello,
I'm new to this list, but have been using Visual Python for a while and
find it to be an outstanding tool. I have been working on a fairly
complex project with it, and have one question that I can't seem to find
an answer to in either the doc or the archives.
Is there _any_ way (direct or indirect) to specify the exact position of
the camera in 3D coordinates? Apparently the camera orientation can only
be changed with scene.center, but how about the position? The
scene.mouse.camera attribute is read-only, so the doc says to change
scene.center and scene.forward to change the camera position. While the
camera position does change when I change those 2 controls, I still have
been unable put the camera where I want it (e.g., to put the camera back
where it started prior to a user mouse-zooming around).
Perhaps this is related to the fact that I don't understand how the camera
is positioned in the first place. At the bottom of this e-mail I've
attached a very simple example that shows where the camera is located as
one mouse-zooms around. Why does the camera start at [0,0,3]? And how,
after some zooming, could I put it back there? Setting scene.center and
scene.forward to their initial conditions (after a mouse-move) does not
put the camera back at [0,0,3] ...
Any pointers or clarification would be greatly appreciated.
Cheers,
Gary Strangman
from visual import *
sphere()
scene.autoscale = 0
scene.autocenter = 0
old = (0,0,0)
while 1:
if old[0]<>scene.mouse.camera[0] or old[1]<>scene.mouse.camera[1] or old[2]<>scene.mouse.camera[2]:
print scene.mouse.camera, scene.center, scene.forward, scene.up, scene.fov
old = scene.mouse.camera
--------------------------------------------------------------
Gary Strangman, PhD | Neural Systems Group
Office: 617-724-0662 | Massachusetts General Hospital
Fax: 617-726-4078 | 13th Street, Bldg 149, Room 9103
st...@nm... | Charlestown, MA 02129
http://www.nmr.mgh.harvard.edu/Neural_Systems_Group/gary/
|