from visual import *
import random
random.seed()
canvas = display(autocenter = False, autoscale = False, userzoom = 0)
canvas.width = 800
canvas.height = 600
canvas.range = (800, 1, 1)
canvas.center = (0, 550)
canvas.select()
test = sphere(radius = 20, pos = (100,100))
while True:
rate(60)
x = random.randint(0, 800 - 1)
y = random.randint(0, 600 - 1)
test.pos = vector(x,y)
--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think you probably meant "canvas.center = (canvas.width/2, canvas.height/2)" to use the full display. Similarly, "canvas.range = 400" will make the positions populate the full display; 400 is the maximum distance from the center to the edge.
$ brew list wxmac
/usr/local/Cellar/wxmac/3.0.2/bin/wx-config
/usr/local/Cellar/wxmac/3.0.2/bin/wxrc
/usr/local/Cellar/wxmac/3.0.2/bin/wxrc-3.0
/usr/local/Cellar/wxmac/3.0.2/include/wx-3.0/ (730 files)
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_baseu-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_baseu_net-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_baseu_xml-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_adv-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_aui-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_core-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_gl-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_html-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_media-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_propgrid-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_qa-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_ribbon-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_richtext-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_stc-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_webview-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/libwx_osx_cocoau_xrc-3.0.0.2.0.dylib
/usr/local/Cellar/wxmac/3.0.2/lib/wx/ (2 files)
/usr/local/Cellar/wxmac/3.0.2/lib/ (32 other files)
/usr/local/Cellar/wxmac/3.0.2/share/aclocal/wxwin.m4
/usr/local/Cellar/wxmac/3.0.2/share/bakefile/ (5 files)
/usr/local/Cellar/wxmac/3.0.2/share/locale/ (22 files)
mathsaey@Anduin:~$ brew info wxmac
wxmac: stable 3.0.2 (bottled)
/usr/local/Cellar/wxmac/3.0.2 (777 files, 41M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/wxmac.rb
==> Dependencies
Required: jpeg ✔, libpng ✔, libtiff ✔
==> Options
--with-static
build static libraries
--with-stl
use standard C++ classes for everything
mathsaey@Anduin:~$ python -c 'import wx; print wx.version()'
3.0.0.0 osx-cocoa (classic)