Questions tagged [vpython]

A free, open-source module for producing real-time 3D scenes with Python.

VPython makes it unusually easy to write programs that generate navigable real-time 3D animations. It is based on the Python programming language.

See http://vpython.org/

345 questions
0
votes
1 answer

UnboundLocalError: local variable 'p' referenced before assignment

def partial(f,h=0.0001): #checker x=y=z=1 fx=(f(x+h,y,z)-f(x,y,z))/h fy=(f(x,y+h,z)-f(x,y,z))/h fz=(f(x,y,z+h)-f(x,y,z))/h if(fx==0): p=0 elif(fy==0): q=0 elif(fz==0): r=0 fx=fy=fz=0 …
Kabir Thakur
  • 1
  • 1
  • 5
0
votes
2 answers

Using Vpython to simulate sun-earth-moon orbit

I am trying to use Newton's 2nd law to simulate sun-earth-moon system. I can get the moon and earth parallely rotating around the sun. But the moon does not rotate around the earth. I know there should be attraction between the moon and sun, and…
KittyL
  • 101
  • 1
  • 5
0
votes
0 answers

How to execute VPython through Komodo (no module named "visual" error)

On running scripts through an OSX-Mavericks machine that import the visual module from VPython, Komodo Edit throws up an error saying something to the effect of "no module named 'visual'". I've played around with the placing of the VIDLE program,…
0
votes
1 answer

Is it possible to combine VPython and Pygame?

I need to use a joystick for a vpython project, Is it possibe to combine pygame module and vpython to be able to use joystick functions of the pygame module?
0
votes
1 answer

3D objects real time moving in python

Hi everyone I am a beginner and I need to design a 3D world editor in python, I found a great code to start off here: http://vpython.org/contents/contributed/chessboard.py I tried to add an infinite while loop at the end of the code repeatingly…
0
votes
1 answer

Where can I find VIDLE?

I am new to Python. I was trying to learn Python using Anaconda Python 2.7 and its Spyder app. I'd like to use Vpython to create 3D objects. So I installed vpython using conda install -c mwcraig vpython which is what they suggested and it worked. I…
KittyL
  • 101
  • 1
  • 5
0
votes
1 answer

Strange Future Warning Error after Vpython Installation

First I installed Python 2.7.6 (Windows, 32-bit version), then numpy 1.9.1, and then VPython 6.10. After that, I'm getting this error: Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or…
Navendra
  • 116
  • 13
0
votes
0 answers

VPython installation error on Windows

>>> import visual RuntimeError: module compiled against API version 9 but this version of numpy is 7 Traceback (most recent call last): File "", line 1, in import visual File…
Navendra
  • 116
  • 13
0
votes
0 answers

Python - vpython won't run files

I'm having trouble running functions in Vpython. I'm very new to this, I have a basic understanding of python, but I am experienced in other programming languages. When I use Python's IDLE, I can save a function in a file named "test.py", hit F5,…
user3475234
  • 1,503
  • 3
  • 22
  • 40
0
votes
1 answer

Iterating a function to display updated position every run in VPython

The position of a box is updated by sending the position data in a list currentTargetPos. But when I run the following code in some loop, VPython displays a trail of all the positions box was given. There is this situation with the display. I want…
user2698178
  • 366
  • 2
  • 11
0
votes
1 answer

Error in Python when using VPython

I am getting an error when I try to import anything or try to modify numpy statement to import anything other than from numpy import arange like from numpy import *, or add any other import statements. I also can't make my radius random floats it…
FireFistAce
  • 41
  • 3
  • 12
0
votes
1 answer

Slowing down a physics defying spring

I am doing a tutorial for my physics class. I made a program that should have a cart on a box that is moved by a spring and should slow down to a stop, however, when I run it, it appears the spring is accelerating the cart (no matter which things I…
hoytick
  • 5
  • 4
0
votes
2 answers

How to deactivate keyboard buffer in Windows?

I'm trying to program something using vPython. It's kind of a game, but controls won't work properly. while True: "verarbeitet Maus/Tastatureingaben" if scene.kb: # wenn Aktion auf der Tastatur... …
vossmalte
  • 174
  • 2
  • 2
  • 16
0
votes
1 answer

Python and Boost - Trying to run vPython and getting __doc__ is read only error.

How to get vPython working? I'm running on Mac OS X with Python 2.6 , and recently downloaded vPython. Upon installation it also installs the Boost libraries for Python. Now, when I try to import the vPython libraries ('visual'), the following…
Duncan Tait
  • 1,997
  • 4
  • 20
  • 24
0
votes
1 answer

Programming in vpython, vpython doesb't react at code

I want to make a program that shows the da vinci tower in vpython and I think I got the right code to rotate the floors each in a sequence like in the da vinci tower. But vpython doesn't respond. What I'm I doing wrong? Can someone please help? from…