GlowScript

From Physics Book
Revision as of 14:57, 13 April 2019 by Hkim944 (talk | contribs) (Initial edit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Claimed by hkim944 (Spring 2019)


GlowScript IDE is an environment where people can create 3D animations and share them on web.
Scripts can be written in VPython.

Commands

Header


GlowScript 2.7 VPython is required in header to run Vpython.
GlowScript 2.7 JavaScript is required in header to run javascript.


Initialize new Variables


Use var and assign values.

var x, y
x = 2
y = 3

There is no need to put semi-colon in the end of a line.

3D Objects


Arrow

newArrow = arrow(pos=vec(x0, y0, z0), shaftwidth=1, axis_and_length=vec(x1, y1, z1))

This creates arrow that starts at point <x0, y0, z0> that points <x1, y1, z1>

Box

newBox = box(pos=vec(x0, y0, z0), size=vec(L, H, W))

This creates a box with a center <x0, y0, z0> and with size <L, H, W>

Sphere

newSphere =sphere(pos=vec(x0, y0, z0), size=vec(x1, y1, z1) )

This creates a box with a center <x0, y0, z0> and with size <x1, y1, z1>

You can learn more by clicking this. [1]

Supported Environments

Browsers: Chrome, Firefox, Safari, Internet Explorer, and Edge.
Devices: Most smart devices running Android or iOS.