Skip to content

Commit 1c87ef6

Browse files
committed
Update offline docs
1 parent c23b717 commit 1c87ef6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+271
-220
lines changed

GlowScriptOffline/VPythonDocs/MathJax.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>MathJax</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
@@ -30,12 +30,12 @@
3030
<div id="content">
3131
<!-- InstanceBeginEditable name="content" -->
3232
<div>
33-
<h1 class="Heading-1"><font color="#0000A0">Math displays using LaTeX</font> - GlowScript VPython only</h1>
33+
<h1 class="Heading-1"><font color="#0000A0">Math displays using LaTeX</font> - Web VPython only</h1>
3434
</div>
3535
<div>
36-
<p class="Normal">In GlowScript VPython (but not currently in VPython 7) you can display complex mathematical expressions expressed in the widely used math editing format, <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>. Here is <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/LaTexMathDisplay" target="_blank">an example</a></strong>. The LaTeX capability is provided by <a href="http://www.mathjax.org/" target="_blank">MathJax</a>, which is imported by GlowScript. For example, consider this mathematical display:</p>
36+
<p class="Normal">In Web VPython (but not currently in VPython 7) you can display complex mathematical expressions expressed in the widely used math editing format, <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>. Here is <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/LaTexMathDisplay" target="_blank">an example</a></strong>. The LaTeX capability is provided by <a href="http://www.mathjax.org/" target="_blank">MathJax</a>, which is imported by Web VPython. For example, consider this mathematical display:</p>
3737
<p class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/MathJax.jpg" width="350" height="48" alt="equation" /></p>
38-
<p class="Normal">You can display this in the caption of an existing GlowScript canvas with the following statements:</p>
38+
<p class="Normal">You can display this in the caption of an existing Web VPython canvas with the following statements:</p>
3939
<p class="program"> box()<br />
4040
scene.caption = &quot;Final kinetic energy = \\( \\dfrac {1} {2}mv_i^{2}+\\int _{i}^{f}\\vec{F}\\circ d \\vec{r} \\)&quot;<br />
4141
<br />

GlowScriptOffline/VPythonDocs/VisualIntro.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>VPython Introduction</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
@@ -34,7 +34,7 @@ <h1 class="Title" align="center"> <font color="#FF0000">Simple 3D Programming
3434
Using VPython</font> </h1>
3535
<div>
3636
<h3 class="Heading-1"> <font color="#0000A0">I. Getting started</font></h3>
37-
<p class="Normal">To write a VPython program in the browser, sign in at glowscript.org, click the link to your programs, then click Create New Program. A blank edit page will open with a header line that says something like &quot;GlowScript 3.0 VPython&quot;. Start typing your program on the second line. Click &quot;Run this program&quot; to try out your program.</p>
37+
<p class="Normal">To write a VPython program in the browser, sign in at glowscript.org, click the link to your programs, then click Create New Program. A blank edit page will open with a header line that says something like &quot;GlowScript 3.2 VPython&quot;. Start typing your program on the second line. Click &quot;Run this program&quot; to try out your program.</p>
3838
</div>
3939
<div>
4040
<h3 class="Heading2"> <font color="#0000A0">The canvas</font></h3>
@@ -134,8 +134,8 @@ <h3 class="Heading-1"> <font color="#0000A0">III. Simple Python Programming</fon
134134

135135
<h3 class="Heading2"><font color="#0000A0">Using the 3D Graphics Module</font></h3>
136136

137-
<p class="Normal"> The necessary first line of your program is created for you, and looks like this, if the current version is 3.0:</p>
138-
<p class="program"> GlowScript 3.0 VPython</p>
137+
<p class="Normal"> The necessary first line of your program is created for you, and looks like this, if the current version is 3.2:</p>
138+
<p class="program"> GlowScript 3.2 VPython</p>
139139

140140
<h3 class="Heading2"><font color="#0000A0">Comments</font></h3>
141141
<p class="Normal"> A comment in a Python program starts with &quot;#&quot;</p>

GlowScriptOffline/VPythonDocs/arrow.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>arrow</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
@@ -60,10 +60,11 @@
6060
is significant for arrow because the shaft and head have square
6161
cross sections, and setting the <em class="program"> </em><span class="attribute">up</span> attribute
6262
rotates the arrow about its axis. Additional arrow attributes:</p>
63-
<p class="attributes"> <span class="attribute">shaftwidth</span> By default, shaftwidth
63+
<p class="attributes"> <span class="attribute">round</span> By default, <span class="attribute">round</span> is <span class="attribute">False</span> and the arrow has a square cross-section. If <span class="attribute">round</span> is <span class="attribute">True</span>, it has a circular cross-section. The <span class="attribute">round</span> attribute cannot be changed after creating the arrow.</p>
64+
<p class="attributes"> <span class="attribute"></span><span class="attribute">shaftwidth</span> By default, shaftwidth
6465

65-
= 0.1*(length of arrow)</p>
66-
<p class="attributes"> <span class="attribute">headwidth</span> By default, headwidth
66+
= 0.1*(length of arrow)</p>
67+
<p class="attributes"> <span class="attribute">headwidth</span> By default, headwidth
6768

6869
= 2*shaftwidth</p>
6970
<p class="attributes"> <span class="attribute">headlength</span> By default, headlength

GlowScriptOffline/VPythonDocs/box.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>box</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />

GlowScriptOffline/VPythonDocs/canvas.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>canvas</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" /><!-- InstanceEndEditable -->
@@ -49,7 +49,7 @@ <h1 class="Heading-1"> <font color="#0000A0">Controlling One or More VPython
4949
<p class="Normal"><span class="attributes"><strong>Selecting a canvas:</strong> By default, any objects that you create go into the most recently created canvas, such as <span class="attribute">scene</span>. If you create another canvas <span class="attribute">cvs</span>, new objects will go into the <span class="attribute">cvs</span> canvas. You can later execute <span class="attribute">scene.select()</span> to make the <span class="attribute">scene</span> canvas the one that new objects go into.</span> You can find out which canvas is selected: <span class="attributes"><span class="attribute">current = </span><font color="#FF0000">canvas.get_selected()</font> returns
5050
a reference to the canvas into which objects are currently being
5151
created.</span> You can also specify which canvas to use when creating an object, as in box(canvas=cvs, .....).</p>
52-
<p class="Normal">In GlowScript VPython you can say canvas.selected = cvs, or current = canvas.selected, but unfortunately it doesn't seem possible to implement this syntax in VPython 7, so for compatibiity between GlowScript VPython and VPython 7 you may wish to use cvs.select() and canvas.get_selected() in GlowScript programs.</p>
52+
<p class="Normal">In Web VPython you can say canvas.selected = cvs, or current = canvas.selected, but unfortunately it doesn't seem possible to implement this syntax in VPython 7, so for compatibiity between Web VPython and VPython 7 you may wish to use cvs.select() and canvas.get_selected() in Web VPython programs.</p>
5353
<p class="Normal">Here is a summary of what determines in which of several possible 3D canvases an object such as a box or sphere will be placed:</p>
5454
<p class="program">scene = canvas() # automatic; you don't need to say this<br />
5555
box(...) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# will appear in the canvas named &quot;scene&quot;<br />
@@ -85,15 +85,15 @@ <h1 class="Heading-1"> <font color="#0000A0">Controlling One or More VPython
8585
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.color = color.red </p>
8686
<p class="attributes"> <span class="attribute">visible </span>Setting scene.visible = False means that no objects are displayed, until scene.visible is set True again.</p>
8787
<p class="attributes"><span class="attribute">delete() </span>Deletes all the objects in this canvas and then deletes the canvas itself</p>
88-
<p class="attributes"><span class="attribute">capture(filename) </span>Sends to your Download folder a png screen shot of the canvas. If filename is the string &quot;boxes&quot; or &quot;boxes.png&quot; the file will be named &quot;boxes.png&quot;. Because label objects are displayed in a separate 2D transparent canvas in front of the 3D canvas, labels are not displayed in a captured scene. If you need text to be part of the captured scene, use the 3D text() object.</p>
88+
<p class="attributes"><span class="attribute">capture(filename) </span>Sends to your Download folder a png screen shot of the canvas. If filename is the string &quot;boxes&quot; or &quot;boxes.png&quot; the file will be named &quot;boxes.png&quot;. If you execute scene.capture(&quot;boxes&quot;) repeatedly, the additional files will be named &quot;boxes(1).png&quot;, &quot;boxes(2).png&quot;, etc. If you do not want to capture "label" objects, execute scene.capture(filename, False)</p>
8989
<p class="attributes"><span class="attribute"><font color="#000000">To obtain the current location of the camera, <a href="#camera"><strong>see </strong></a></font></span><strong><a href="#camera">below</a></strong> for details of <span class="attribute">scene.camera.pos</span><font color="#000000">.</font></p>
9090
<p class="attributes"><span class="attribute">camera.follow</span> If you say <span class="attribute">scene.camera.follow(ball)</span>, the center of the scene will continually be reset to the current position of the ball object. To stop following the object, execute <span class="attribute">scene.camera.follow(None)</span>.</p>
9191
<p class="attributes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instead of specifying an object to follow, you can provide a function of your own:</p>
9292
<p class="program"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def f():<br />
9393
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 2*ball.pos<br />
9494
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scene.camera.follow(f)</p>
9595
<p class="attributes"></p>
96-
<p class="attributes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, in GlowScript VPython you can specify an &quot;anonymous&quot; (unnamed) function, though this does not work in true Python:</p>
96+
<p class="attributes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, in Web VPython you can specify an &quot;anonymous&quot; (unnamed) function, though this does not work in true Python:</p>
9797
<p class="program">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scene.camera.follow(def ():<br />
9898
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 2*ball.pos<br />
9999
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</p>
@@ -200,7 +200,7 @@ <h1 class="Heading-1"> <font color="#0000A0">Controlling One or More VPython
200200
<p class="Normal"><strong><font color="#0000A0">Controlling the view using scene.camera</font></strong></p>
201201
<p class="Normal">The mechanisms described above for controlling the view are designed to try to make sure that the objects are visible no matter how the user rotates or zooms the view, because the camera direction is always automatically adjusted to point toward scene.center, which by default is at the origin, and scene.range is automatically adjusted to correspond to the user zoom.</p>
202202
<p class="Normal">However, if you want to &quot;fly&quot; through the scene, with scene.center necessarily varying but zoom held constant, it is more convenient to move and point the camera directly. <span class="attribute"><strong><em>WARNING: </em></strong></span>When you take direct control of the camera, there is increased risk of seeing nothing, due to unintentionally pointing the camera away from the objects, or moving the camera far away from the objects. </p>
203-
<p class="Normal">An example of controlling the camera directly is the fly-through in the program <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Stonehenge-VPython" target="_blank">Stonehenge</a></strong>, in which changing <span class="attribute">scene.camera.pos</span> (the location of the camera) and <span class="attributes">&nbsp;<span class="attribute">scene.camera.axis</span></span> (the direction the camera is pointing) is a convenient way to move through the scene.</p>
203+
<p class="Normal">An example of controlling the camera directly is the fly-through in the program <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Stonehenge-VPython" target="_blank">Stonehenge</a></strong>, in which changing <span class="attribute">scene.camera.pos</span> (the location of the camera) and <span class="attributes">&nbsp;<span class="attribute">scene.camera.axis</span></span> (the direction the camera is pointing) is a convenient way to move through the scene. Using these statements means that you are controlling the view, so autoscaling is turned off (scene.autoscale is set to False).</p>
204204
<p align="center" class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/camera2.png" width="650" height="240" alt="canvas" /></p>
205205
<p class="attributes">&nbsp; </p>
206206
<p class="attributes">&nbsp;<span class="attribute">scene.camera.pos</span><span class="Normal"> The current

GlowScriptOffline/VPythonDocs/clone.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>clone</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />

GlowScriptOffline/VPythonDocs/color.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" --><head>
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<!-- InstanceBeginEditable name="doctitle" -->
4-
<title>VPython Help</title>
4+
<title>color</title>
55
<!-- InstanceEndEditable -->
66
<!-- InstanceBeginEditable name="head" -->
77
<link href="VisualRef.css" rel="stylesheet" type="text/css" />

0 commit comments

Comments
 (0)