zoom without mouse

332 views
Skip to first unread message

Arun Jayapal

unread,
Jan 12, 2015, 10:42:57 AM1/12/15
to vpytho...@googlegroups.com
I am using vpython from ubuntu on my laptop. I only have a standard trackpad. Normally, I can scroll using the edges of the trackpad by swiping...when trying to do so with the graphics window, it doesn't work. I have to connect the mouse to be able to zoom in and out...

Any keyboard way of doing so?

-arun

Bruce Sherwood

unread,
Jan 12, 2015, 11:05:25 AM1/12/15
to vpytho...@googlegroups.com
Yes. Hold down the ctrl key while dragging to spin, or the alt key while dragging to zoom.

Arun Jayapal

unread,
Jan 12, 2015, 11:43:32 AM1/12/15
to vpytho...@googlegroups.com
But thats still using the mouse...? Else how do you drag to spin?

-arun

Bruce Sherwood

unread,
Jan 12, 2015, 12:25:04 PM1/12/15
to vpytho...@googlegroups.com
How do you drag a window without using a mouse? There must be some way to do that with the pad, right? Do that, but with alt or ctrl depressed, to zoom or spin.

Arun Jayapal

unread,
Jan 12, 2015, 1:18:07 PM1/12/15
to vpytho...@googlegroups.com
The ctrl/alt buttons don't work like how you say it. I have to right-click and drag to be able to rotate the figure generated. But for zooming those buttons don't work.

-Arun

Bruce Sherwood

unread,
Jan 12, 2015, 1:53:28 PM1/12/15
to vpytho...@googlegroups.com
Ah. Perhaps you are using a very old version of VPython. If you execute

from visual import *
print(version)

I'm guessing that you'll see a version number of 5.12, which is very old (2009) but the latest version that is part of standard Linux distributions. The current version is 6.10, soon to be 6.11 with a release that should happen today; the new version will be available on the download pages at vpython.org.

Arun Jayapal

unread,
Jan 12, 2015, 10:51:44 PM1/12/15
to vpytho...@googlegroups.com
Yes. Thankyou. That seems to be the issue. I am using an ubuntu os on my laptop. I had vpython installed via apt-get.

-Arun

Arun Jayapal

unread,
Jan 16, 2015, 10:27:41 PM1/16/15
to vpytho...@googlegroups.com
I have installed from source.

Its quite cumbersome to zoom using only trackpad. Perhaps this is an issue in ubuntu too, i guess. I am able to get the zoom at random, but unable to figure out the order in which I have to do it. Alt+right-click+swipe up/down or other way around. When I do alt+right-click I always get the context menu of the window.

Bruce Sherwood

unread,
Jan 17, 2015, 12:35:55 AM1/17/15
to vpytho...@googlegroups.com
It's not clear whether you're still using VPython 5.12 or a current version, but in 5.12 alt played no role in zooming. 

In VPython 6.x it is alt + left_mouse_button, dragging up and down on the screen, and to rotate it is ctrl + left_mouse_button, dragging perpendicular to the rotation axis. Alternatively, zoom is left_mouse_button + right_mouse_button dragging, while rotate is right_mouse_button dragging.

Arun Jayapal

unread,
Jan 18, 2015, 10:56:26 AM1/18/15
to vpytho...@googlegroups.com
Yes. That clears things up a bit. Somehow right-mouse click + swipe helped me rotate the figure. But now things are working as you said. Thanks.

Renyuan Lyu

unread,
Aug 4, 2016, 6:31:50 PM8/4/16
to VPython-users
Problem:    Zooming function in a no-mouse environment:

Description:

I am using a classic version of vpython,
I have the similar problem about zooming function without a mouse while using a Windows Surface Pro 4 touch pad/screen.
I found that alt-key can pause the running scene. But the zooming function does not work.

Because I need using Python 3.4, so I download a version from

    VPython-5.74-cp34-none-win_amd64.whl

But when I 

    >>> print(version)
    ('5.72', 'release')
    >>> 
So, I am not sure which version number (5.74 or 5.72) I am using.


Bruce Sherwood於 2015年1月17日星期六 UTC+8下午1時35分55秒寫道:

Bruce Sherwood

unread,
Aug 4, 2016, 8:22:07 PM8/4/16
to VPython-users
Classic VPython doesn't process touch inputs, but both GlowScript VPython and Jupyter VPython (which uses the GlowScript library) do handle touch inputs. Try this example:


Jupyter VPython works with Python 3 as well as with Python 2.
Reply all
Reply to author
Forward
0 new messages