Questions tagged [vpython]
A free, open-source module for producing real-time 3D scenes with Python.
344
questions
0
votes
0
answers
15
views
How can I get vpython results to show inline in jupyterlab?
Jupyterlab hangs and does not display the results of evaluation when I try to run any graphical vpython code, eg...
from vpython import *
canvas()
box(vector-(0,0,0))
I have tried this in both colab ...
1
vote
2
answers
53
views
Getting an error when running import vpython, can someone help me out?
Installed vpython via cmd: c:\Users>pip install vpython
Using Python 3.9.9
After installation I tested in cmd using python -m vpython.test and got the following error:
PS H:\Preston\folders\...
0
votes
0
answers
18
views
Is there a way to display the x,y,z axis and change the names in vpython?
I want to display the x,y,z axis with another name (x1,x2,x3) in a 3d vpython figure. Is there a way to do this besides defining 3 arrows?
0
votes
0
answers
23
views
vpython and pyinstaller: "file separator seems to be c\"
I have a python script that uses vpython. I used the following command to create the exe
pyinstaller --onefile --debug=all --add-data "/users/userid/.conda/envs/math/Lib/site-packages/vpython/...
0
votes
0
answers
26
views
Creating a pyramid around a fractal in VPython
I am trying to create my own fractal using VPython. I currently have this hexagonal shape:
The formula of this fractal is
I have added some height to make it a sort of pyramid without sides:
I ...
0
votes
1
answer
33
views
I'm building this double bouncing ball simulation with vpython and am running into a weird rubber banding issue
Im trying to make a pair of balls bounce in 1D space and let them colide. I'm running it on glowscript which uses webVPython, should be the same as VPython from what I can tell.
I keep running into ...
0
votes
1
answer
36
views
Change button size in vpython on Pydroid
I have the following code in Pydroid. I creates 3D text in Python on Android. I need to make the button bigger.
import asyncio
from vpython import *
scene = canvas()
scene.width = 1600
scene.height =...
0
votes
0
answers
22
views
About vpython for non-linear pendulum problem
What is the problem with damped solution, what do I need to change, do I have a definition error?Or is the mathematical model wrong?
from vpython import sphere, cylinder, color, rate, vector, gcurve, ...
0
votes
0
answers
23
views
Installing vpython on replit
I go to packages and I search for vpython and I click install. It notifies that "vpython is installed" but it does not show up as installed.
-1
votes
1
answer
13
views
Obtain the rotation vector/axis of canvas in vpython
Is it possible and if so to get the rotation vector/axis of the canvas?
I would like to implement dragging in 3D
2
votes
2
answers
46
views
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....
2
votes
1
answer
41
views
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 ...
1
vote
1
answer
31
views
Location of VPython library
Where is vpython installed?
When I enter in the terminal the command: pip install vpython,There are some processes in the log, but in the end I don’t see any files of this library in the root folder ...
0
votes
1
answer
30
views
It keeps saying "ReferenceError: Can't find variable: math"
So I'm supposed to write a Python program that creates 3 circles of spheres: one on the xy plane, one in the yz plane, and one in the xz plane. Each ring should be centered on the origin, and I'm ...
0
votes
1
answer
118
views
nbviewer can not display vpython result
If a Jupyter Notebook file is rendering too long in GitHub, it is recommended here to show it in nbviewer, since it is an issue with GitHub backend.
From here, which I do not understand
nbviewer does ...
0
votes
0
answers
161
views
modulenotfounderror no module named 'visual'?
I am trying to convert a py file from VPython 2.7 Program to exe file (in windows) but I am getting an error that says.
ModulNotFoundError: No module named 'visual'
Can you guys please guide me on how ...
0
votes
0
answers
46
views
Is there a way to detect collisions using Circular based Extrusions in VPython?
I am currently working on a project in VPython that requires me to use Circular Based extrusions, I am currently in the process of finding a way to make the Extrusions collide with each other like ...
0
votes
1
answer
31
views
Putting one image in each box side
I want to put for each side of the box (6 sides), one image
face: image1.jpg
left: image2.jpg
right:image3.jpg
top: image4.jpg
bottom:image5.jpg
behind:image6.jpg
Is there a way to do it ?
here is the ...
0
votes
0
answers
89
views
Python - Easy 3D rendering scene guidance
I am doing a robotics project in Python and I want to add a real-time 3D visualiser. I have the CAD files (from SOLIDWORKS, they could be STL, STEP or probably converted tomost 3D formats) and I want ...
2
votes
1
answer
76
views
How to depict small charges on a spherical object using vpython library?
I am working on a project related to charge distribution on the sphere and I decided to simulate the problem using vpython and Coulomb's law. I ran into an issue when I created a sphere because I am ...
0
votes
0
answers
29
views
How can I animate a cylinder that's decreasing in height?
I'm trying to Animate a cylinder standing upright that decreases its height through time. To be specific I wanted the height to decrease starting from the bottom so when I run the program the cylinder ...
0
votes
0
answers
177
views
Vpython on Raspberry Pi 4b
i bought a rapberry pi 4 to code, i know is not the best platform, but recently my computer got stolen and its all i can afford right know.
im trying to get vpython to run.
these is the code that im ...
0
votes
0
answers
118
views
Best Python Package for Animating Robotic Arm
I'm starting a project which will encompass upgrading an old 1983 Yanmar B3 excavator I have sitting in the yard to have a digital read out of bucket position. I will be using a raspberry pi for ...
0
votes
1
answer
40
views
Is there a function or way to determine which files of a package are being used in python?
I'm currently working on a project which uses VPython and I'd like to look into the library's source code. The only problem is that I'm unsure which VPython files are being used when I use VPython in ...
3
votes
1
answer
1k
views
import vpython produces error: float division by zero
I work with Python 3.10.0. I installed vpython using pip, it was installed successfully.
Then when I just use:
from vpython import *
print('hello')
hello is printed, and after that I get the ...
0
votes
1
answer
89
views
Vpython Error: 'float' object has no attribute '_x'
I am writing a Vpython simulation for projectile motion and keep getting the error ('float' object has no attribute '_x') on this line(ball.vel.y = ball.vel.y + g*dt) . I have tried changing the ...
0
votes
1
answer
294
views
What are the differences between Manim and VPython (Web VPython) for 2D or 3D animations?
What are the main differences between Manim and VPython (Web VPython) for 2D or 3D animations from a user perspective? In other words, what can be accomplished in one but not the other?
Which is most ...
-1
votes
1
answer
55
views
How to capture an output image generated by the box function of python visual module?
I am using the box() function provided by the visual module of Python. I want to capture the output image rendered by the display() function as a .png file. I am using scene.capture('test4312'). But ...
0
votes
0
answers
34
views
Can you help a newbie out
The position of an aerial imaging drone can be described by the following expression:
r(t) = (3 m) cos((0.6π r/s)t) ı̂+ (2 m) sin((0.6π r/s)t) ȷ̂+ (0.05 m/s^2)t^2k.
Note the arguments of the ...
1
vote
1
answer
274
views
How to display animation made by vpython in tkinter?
from vpython import *
from tkinter import *
root=Tk()
frame=Frame(root)
frame.pack()
wall=box(pos=vector(0,1,0),size=vector(0.2,3,2),color=color.green)
floor=box(pos=vector(6,-0.6,0),size=vector(14,0....
1
vote
0
answers
1k
views
pyinquirer 1.0.3 requires prompt_toolkit==1.0.14, but you have prompt-toolkit 3.0.28 which is incompatible
Trying to figure out how to programmatically generate 3D models, found a series of YouTube tutorials using vpython, tried to install vpython. pip install vpython It installs, most of it looks fine.
...
1
vote
1
answer
239
views
Vpython localhost opens but keeps forever blank
I have installed vpython from the terminal using pip install vpython, and it installed successfully. I am using python 3.10.2. When I write from vpython import * nothing happened. Then I write vp.box()...
0
votes
1
answer
118
views
Extract Canvas or Jpeg Image out of Vpython Rendered Output using script
Hope you are all doing well.
I am trying to draw a 3D-text which I want to embed into an HTML document.
So for this I found vpython which can draw 3D text and render result in browser window using ...
0
votes
1
answer
84
views
running vpython in a virtual environment
I am running python 3.9.9 in vs code and Windows 10. When I run vpython in a standard(global) program my browser opens and the picture appears. When I run vpython in a virtual environment the browser ...
0
votes
1
answer
41
views
How do I get the pendulums to syncrochnize in my simulation?
I'm making a simulation of pendulum motion using a simple gravity pendulum in VPython.
The relationships appear to be according to what is expected except, when I start a pendulum at a lower angle it ...
1
vote
0
answers
545
views
VPython isn't Running with Visual Studio Code
When I try to run any vpython program on Visual Studio Code, it shows this error:
0:38: execution error: An error of type -10673 has occurred. (-10673)
69:77: execution error: Google Chrome got an ...
0
votes
0
answers
118
views
Vpython text as current time
I'm a beginner with vpython, trying to make something like clock using text. The problem is that text actually changes but the older one stays, I have tried setting up visibility to flase, but it ...
0
votes
1
answer
79
views
Solving the VIBRATNIG STRING simulation oproblem in VPYTHON/ python
I am a true beginner in python and right now I am stuck with the code below, I can't figured our how to move forward with it. It doesb't show me a curve which I am trying to code. The idea is that it ...
0
votes
1
answer
100
views
Yaw rotation of gear object in vpython
I was wondering how to yaw gear object about Y-axis in vpython. I have been following some tutorials and I have managed to rotate the gear. The gear rotates about Z axis in vpython. I want the gear to ...
3
votes
1
answer
482
views
how to fix the position of canvas and graph in vpython?
Before I say it, Sorry for my poor English.
I'm making an orbit simulation with vpython, because the earth science teacher asked me to.
The link below is the result of my work so far.
https://...
0
votes
1
answer
191
views
Change value of variables in Vpython
I'm making a simulation about two springs and one mass. I've made it through VPython using some graphics elements. I used the slider function from Vpython to try to change the variables of radius and ...
0
votes
0
answers
162
views
How to run VPython on Mac offline
I don't have much experience with Python. Don't judge me for that. I just beg you to tell me how to take use of VPython. I already have Python installed on Mac. Version 3.9.8. At least I believe to ...
2
votes
3
answers
544
views
VPython acts weird when used with python installation and won't shut down nicely
I want to build physics simulations using VPython. Although, VPython works great on websites like trinket.io, I'd like to use a nicer IDE than the web one, and I'd like to use real python modules as ...
1
vote
0
answers
109
views
How to run vpython program in Flask
I want to run a vypthon simulation in Flask. I have no idea how, since a lot of different things I have tried always lead to errors.
This is just one example of many things I have tried:
from vpython ...
1
vote
1
answer
645
views
Exception: The non-notebook version of vpython requires Python 3.5 or later
I just bought a new computer so I decided to install python. I installed the last version which is 3.10. Afterwards I decided to installed all the libraries I ussually use. One of my main projects ...
0
votes
1
answer
132
views
How to create and connect functions to vpython button?
I am going to create a GUI interface to calculate time period by taking mass(m) and stiffness(k) as input values from a user. I have tried to create the interface in glowscript but at the time to ...
0
votes
2
answers
806
views
'C:\Users\HP' is not recognized as an internal or external command, operable program or batch file
I tried installing
pip install vpython
Getting error like restart kernel and 'C:\Users\HP' is not recognized as an internal or external command, operable program or batch file.
2
votes
2
answers
325
views
vPython / GlowScript Sensor Position
I'm showing some strange discrepancies between my declared camera position (scene.camera.pos), and the actual camera position. I can't believe this feature is just broken, am I missing something here?
...
1
vote
0
answers
268
views
Is there a way to include a vpython window in a Tkinter frame or canvas?
I'm trying to include an interactive vpython window in a tkinter frame or canvas in order to visualise simple shapes (representing the mechanical assembly that will be sized). I can't find a frame or ...
1
vote
1
answer
70
views
Freefalling objects fly through a center of gravity in VPython, the moment they hit the center though they speed up and shoot out to the side
I have this function here
def gravitationalForce(p1,p2):
G = 1=
rVector = p1.pos - p2.pos
# if vp.mag(rVector) <.01:
# planet1.pos =- planet1.pos
# star.pos = - star.pos
...