disable zoom and pan in view

306 views
Skip to first unread message

Wolfgang Christian

unread,
Oct 26, 2017, 3:47:40 PM10/26/17
to VPython-users
Can I disable zooming and panning in a VPython canvas? I often inadvertently change the camera location when scrolling a Jupyther notebook page and I only need a fixed view.

Bruce Sherwood

unread,
Oct 26, 2017, 4:49:58 PM10/26/17
to VPython-users
Just set scene.userzoom = False and scene.userspin = False. For more information, see


userzoom and userspin are mentioned in the section on controlling the view.

Currently there is no built-in way to "pan" (which normally means moving the camera in the x direction), but I assume you were referring to zoom (moving the camera in the z direction). There was however some discussion on how to pan in the GlowScript forum:

Kevin Karplus

unread,
Oct 27, 2017, 2:12:14 PM10/27/17
to vpytho...@googlegroups.com
Technically, panning a camera is rotating it on its vertical axis.  Pan-tilt heads are standard on tripods—moving a camera smoothly is a more difficult operation in the real world.
So "userspin" is controlling panning.

Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz (on sabbatical F2017)
Affiliations for identification only.


--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Sherwood

unread,
Oct 27, 2017, 3:37:46 PM10/27/17
to VPython-users
Ah, good point. So what is the name for the operation of moving the camera in the x direction?

Actually, "panning" isn't a good description of the userspin operation either, because the camera moves in such a way as to always point toward scene.center, whereas when you "pan" a camera on a tripod the camera stays in one place.

Bruce

Kevin Karplus

unread,
Oct 27, 2017, 6:22:22 PM10/27/17
to vpytho...@googlegroups.com
Moving side to side is "trucking".  Moving towards and away is "dollying".  Moving up or down is "pedestalling".
"Tracking" is used for both "trucking" and "dollying".    I think that the userspin would be considered a circular tracking shot.

Disclaimer: I'm not an expert on film terminology—what little I know comes from reading stuff on the web.

Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz (on sabbatical F2017)
Affiliations for identification only.


--

Bruce Sherwood

unread,
Oct 27, 2017, 6:47:25 PM10/27/17
to VPython-users
Looks like computer graphics terminology is quite different from movie terminology. I searched for "computer graphics panning" and the first hit was this:

In video technology, panning refers to the horizontal scrolling of an image wider than the display. For 3D modeling in computer graphicspanning means moving parallel to the current view plane. In other words, the camera moves perpendicular to the direction it is pointed.

So it would seem that my use of the word "panning" in the VPython context was correct after all. Certainly "zooming" is also the computer graphics term. 

Bruce

Kevin Karplus

unread,
Oct 28, 2017, 3:20:30 AM10/28/17
to vpytho...@googlegroups.com
Zooming and dollying are different—one changes the angle of the view, the other changes the location of the camera.  The perspective transforms are different.  Both are available with both conventional cameras and computer graphics.

I recognize that computer graphics people ended up redefining "panning" for something that there was already a name for in the computer world (horizontal scrolling).  It was a bad abuse of terminology, but I guess we have to cope.

Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz (on sabbatical F2017)
Affiliations for identification only.


--
Reply all
Reply to author
Forward
0 new messages