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
3
votes
2 answers

vpython 7 with jupyter notebook kernel jump between busy and idle

I am trying to run a simple ball moving demo program using vpython 7 on jupyter notebook, however, the ball didn't move smoothly, but like jumping from one position to the next position, there are big delays between frames. I ran the same code in…
3
votes
1 answer

Create an angle between two vectors vpython?

I am trying to create an angle symbol using vpython between two vectors. These vectors are the source vector and the x-y projection of this vector. I am using the vpython package and particularly arc from the shapes module of vpython. from vpython…
Khalil Al Hooti
  • 4,207
  • 5
  • 23
  • 40
3
votes
1 answer

from visual import * not working (vpython)

I just downloaded vPython for Python 2.7.9 and got the following error when importing the .visual library: Traceback (most recent call last): File "Untitled", line 1 from visual import * File…
AstroBoy
  • 43
  • 1
  • 1
  • 6
3
votes
0 answers

Rotate a cube using rotation matrix in vpython

I am just doing a cube in vpython that has some option like change the position, rotate in the x,y or z-axis But the problem is that I don't actually know how to rotate the cube using the rotation matrix that is usually used in math. I made the math…
Albert
  • 141
  • 3
  • 12
3
votes
2 answers

How to Annotate/Label an Object (Arrow) in VPython?

I am using VPython to draw coordinate systems. Since I did not find any readily avalible coordinate system object, I thus draw three mutual-perpendicular arrows to represent the coordinate system as follows: y = arrow(pos=(0,0,0), axis=(6,6,0),…
Sibbs Gambling
  • 19,274
  • 42
  • 103
  • 174
3
votes
4 answers

VPython Inheritance

I'm currently trying to make a class for the sole purpose of quickly creating a VPython object and appending additional values to the object. VPython automatically creates an object with such values like position and dimensions. However, I also want…
3
votes
4 answers

Python, Restarting the entire code so that moving objects and everything (not just the loop but the whole code)

I am building a computer simulation of an N Body Problem for my science fair project. I want the simulation/code to playback when it finishes so that it can be constantly viewed by other people that walk by. I am using VPython which has worked fine…
AstroPy
  • 63
  • 7
3
votes
1 answer

Setting Slider Value

Firstly, I don't have much experience with Python. All I'm trying to do is get this slider to give me a variable temp that I can actually use. As it is the damn thing either tells me there's a data type mismatch or simply doesn't report where the…
3
votes
0 answers

possible to use vpython in ipython notebook?

Whenever I use vpython in ipython the kernel will die. is there any solution? I don't know what to do. (My OS is ubuntu 12.04 64 bit, the browser is firefox.)
varantir
  • 6,624
  • 6
  • 36
  • 57
3
votes
1 answer

GTK window capture: VPython (OpenGL) application

Having read the documentation for VPython and GTK threading, it seems to me that it would be possible to embed VPython graphics within a gtk GUI. I know that it is possible with wx on Windows but I am on Linux and using PyGTK. Now, I have managed…
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
3
votes
1 answer

Create a single face in VPython?

After looking around a bit in a (few) documentations of VPython, I haven't found a simple way to make a face from three points, but I think I might be missing something. I'm imagining something like this: f = face(pts=[(x,y,z), (x,y,z), (x,y,z)],…
nebuch
  • 6,475
  • 4
  • 20
  • 39
2
votes
2 answers

Two masses connected by a spring...trying to simulate flight but having difficulties

We have two masses of equal mass 0.1kg connected by a stiff spring with k = 10^5 N/m. The rest length of the spring (and the initial distance between the two masses) is d0 = 0.15m Mass 1 has initial velocity (2.77, 1.25, 0) m/s while mass 2 has…
Bob John
  • 3,688
  • 14
  • 43
  • 57
2
votes
1 answer

VPython Error on Ubuntu 11.10

I get an error when trying to use VPython on Ubuntu 11.10. I installed the program using the Ubuntu Software Center. All the additional instructions that I've found are either for much older versions or confuse me. What do I need to do in order to…
paniwani
  • 659
  • 3
  • 9
  • 18
2
votes
2 answers

Captions of slider not visible (VPython)

I have create a little 3d simulation with VPython. And with it sliders to control positions and colors or objects. However, I can't find a way to display a caption to indicate what is the slider about. I have added an argument when defining the…
Chris Ze Third
  • 632
  • 2
  • 18
2
votes
1 answer

Change local light color using menu (VPython)

I have tried to create a menu to change the color of a local light in my simulation. The simulation is a central sphere being a planet, around an atmosphere with transparency smaller than 1 and a local light source. Here is my code so far: """…
Antonio
  • 111
  • 9
1
2
3
22 23