Questions tagged [glowscript]

GlowScript is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web.

GlowScript is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web.

GlowScript ("Graphics Library on Web") makes it easy to write real-time navigable 3D animations that run in a browser. It is based on the language plus the 3D graphics library, both of which are included in most modern browsers.

The design of GlowScript is based on that of VPython.

Currently supported browsers include Google chrome, Mozilla Firefox, Opera, Internet Explorer, Safari etc.

You should be using this tag if your question is related to GlowScript or its APIs.

21 questions
5
votes
1 answer

"Property 'pos' must be a vector" Error when I run VPython Code

When I run this code I get an error "Error: Property 'pos' must be a vector." Do I have to write another vector somewhere? Because I wrote vector at grav_force = vector(0,-object.mass*grav_field,0) This is my whole code GlowScript 2.7…
Colin Ragnarök
  • 1,062
  • 9
  • 18
2
votes
2 answers

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? Here's the code, and the output shown below …
1
vote
0 answers

Using GlowScript to Create Widgets and Graphics in Different Divs

This is a bit of a messy question because I'm just starting to learn how web development works. I'm attempting to use HTML, JavaScript, and probably CSS (although I'm not really thinking about that yet) to create a simple website. I plan on basing…
1
vote
0 answers

graphs of position vs time, velocity vs time, and acceleration vs time

I want to produce graphs of position vs time, velocity vs time, and acceleration vs time using Vpython in GlowScript IDE. I am modeling a path, so I will have many different segments of the line (ex. starting from rest to constant speed, constant…
1
vote
0 answers

How to find vector coordinates given information of 2 vectors and corresponding angles

I have the coordinates of 2 vectors, and the angles between each vector. I'm trying to form a tetrahedral shape, like the ones in the CH4 molecule. What would be the simplest way to go about doing this? My idea was to have a function with three…
Popolok11
  • 57
  • 9
1
vote
1 answer

GlowScript with PhysUtil program is not running

This is the code I am trying to execute, but it is showing some errors that I cannot understand: GlowScript 2.7 VPython ### INITIALIZE VPYTHON # ----------------------------------------------------------------------- # -*- coding: utf-8…
dim.vez
  • 17
  • 4
1
vote
1 answer

Cannot add scalar and a vector error in VPyhton (GlowScript)

I'm implementing a solar system with VPython in GlowScript. Now I have received this error when running: Error cannot add scalar and a vector. I think I've done all correctly. Do I have to change something with the pos. ? Here is the…
CMC
  • 79
  • 1
  • 3
  • 11
0
votes
0 answers

How to import GlowScript to Pycharm ver.3.9?

I'm currently doing a project in python using Pycharm and it needs to show some 3D charts. In order to do so I would like to use GlowScript. However, I have a problem with importing it to Pycharm and alomost all of solutions on the internet are…
Physicist
  • 1
  • 1
0
votes
0 answers

How can I display(code) the outputs they are asking. I am physics major

rocket = cylinder( pos=vector(0,0,0), color=color.red, size=vector(0.5,0.1,0.1), velocity = vector(0,0,0), mass=100, fuel_mass=10.0, make_trail = True, axis=vector(0,1,0) ) initial_mass = rocket.mass +…
John
  • 1
  • 1
0
votes
0 answers

I am trying to code in glow script an accurate simulation of the orbit of the comet Haley around the sun, but how do i scale up the pace of the simul?

# Scene and Objects for Animation scene = display(title='Orbital Motion', width=500, height=300, background=color.black) sun = sphere(pos=vector(0,0,0), color=color.yellow, radius=6.96342e9) comet = sphere(pos=vector(8.59E10,0,0), radius=4.0E9,…
0
votes
0 answers

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 trigonometric functions are in radians. GlowScript…
0
votes
2 answers

VPython Physics Simulation Lagging After Running Pause Function

I'm making a physics simulation in VPython glowscript, and I need to be able to pause and play my program at the press of a button. So far, I've added the pause/play button, and it works great! However, after unpausing the simulation, Once I've…
0
votes
2 answers

What does window.__context do?

I know it’s usually better to answer these questions with a google search, but I can’t seem to find it anywhere online. I wrote a function for creating a GlowScript canvas and adding it to an inputted div. I based it off of the code given on the…
0
votes
1 answer

in Ipython a function named display gives me an error

# Kepler's Laws.py # plots the orbit of a planet in an eccentric orbit to illustrate # the sweeping out of equal areas in equal times, with sun at focus # The eccentricity of the orbit is random and determined by the initial velocity # program uses…
0
votes
1 answer

Menu in Glowscript

I have already asked a similar question concerning this problem but my colleague and I still weren't able to fix it. For more information on the problem, please see my first question. We have defined different objects (sun and planets of our solar…
Eva12345
  • 1
  • 1
1
2