Skip to content

Commit bd567d3

Browse files
committed
Update glow and docs
1 parent 60fcf22 commit bd567d3

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

ForInstalledPython/glow.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GlowScriptOffline/glowscript_libraries/glow.3.2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GlowScriptOffline3.2.zip

10 Bytes
Binary file not shown.

docs/VPythonDocs/triangle.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
<p class="Normal">In the <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Rug" target="_blank">rug example</a></strong> pictured above, the rug is divided into a rectangular mesh of vertex objects, and quad objects are created from these vertex objects. The same vertex may be shared by as many as four adjacent quad objects. Changing the z position of a shared vertex object affects all those quads that refer to that vertex, which makes it easy to create a moving pulse simply by modifying the vertex positions. In the rug program the quad objects are needed to display the rug, but once the quads have been created all further calculations refer just to the underlying vertex objects.</p>
7878
<p class="Normal">For a triangle or quad, in addition to specifying vertex objects you can specify <span class="attribute">texture</span> and/or <span class="attribute">visible</span>, but the usual attributes for other objects such as <span class="attribute">pos</span> or <span class="attribute">color</span> don't apply; this information is specified in the vertex objects. (It is not possible to specify place, flipx, flipy, or turn for a triangle or quad texture. These effects can be achieved by the way <span class="attribute">texpos</span> is specified in the vertex objects.)</p>
7979
<p class="Normal">If you wish to specify a <span class="attribute">bumpmap</span> to go with a <span class="attribute">texture</span>, use the same scheme used with other objects.<em> <strong>This example assumes that you have specified <span class="attribute">texpos</span> values in the vertex objects (see below):</strong></em></p>
80-
<p class="program">quad(vs=[a, b, c, d], &nbsp;&nbsp;&nbsp;&nbsp;texture=dict(file=textures.stones, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bumpmap=bumpmaps.stones)) </p>
80+
<p class="program">quad(vs=[a, b, c, d], texture=dict(file=textures.stones, bumpmap=bumpmaps.stones)) </p>
8181
<p class="Normal">If you prefer, you can create the dictionary like this::</p>
82-
<p class="program">quad(vs=[a, b, c, d], &nbsp;&nbsp;&nbsp;&nbsp;texture={'file':textures.stones, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'bumpmap':bumpmaps.stones)) </p>
82+
<p class="program">quad(vs=[a, b, c, d], texture={'file':textures.stones, 'bumpmap':bumpmaps.stones)) </p>
8383
<p class="Normal"><strong>Display speedup:</strong> Typically you will use many triangles to create a complex object. For clarity you might wish to keep them all in a list: tris = [ triangle1, triangle2, ....]. If the object's internal shape need not change (unlike the case of the rug), you can say &quot;s = compound(tris)&quot; in which case you can move and resize and rotate the object &quot;s&quot; very rapidly, just as though it were a built-in object such as a sphere.</p>
8484
<p class="Normal"><strong><font color="#0000a0">Vertex attributes</font></strong></p>
8585
<p class="Normal">The attributes of a vertex object are <span class="attribute">pos</span>, <span class="attribute">normal</span>, <span class="attribute">color</span>, <span class="attribute">opacity</span>, <span class="attribute">texpos</span>, <span class="attribute">bumpaxis</span>, <span class="attribute">shininess</span>, and <span class="attribute">emissive</span>. The <span class="attribute">pos</span> attribute represents the location of the vertex in 3D space. </p>
@@ -95,7 +95,6 @@
9595
<p class="Normal">Texel coordinates for a surface texture are specified by an &quot;x&quot; and a &quot;y&quot;, both ranging from 0 to 1 if the entire texture is to be displayed, left to right and bottom to top. (In many discussions texel coordinates are referred to as &quot;u&quot; and &quot;v&quot;, or as &quot;s&quot; and &quot;t&quot;.) In anticipation that WebGL will eventually enable 3D textures, which permit filling a textured volume, VPython requires that in <span class="attribute">texpos</span> elements the third component must be zero.</p>
9696
<p class="Normal">For example, to fill a quad with a texture, the <span class="attribute">texpos</span> vectors in the vertex objects v0, v1, v2, and v3 would be vec(0,0,0), vec(1,0,0), vec(1,1,0), vec(0,1,0), no matter what the 3D <span class="attribute">pos</span> attributes are. If you want only the lower quarter of the texture to fill the quad, the texpos vectors would be vec(0,0,0), vec(0.5,0,0), vec(0.5,0.5,0), vec(0,0.5,0). Note that &lt;0,0,0&gt; is at the lower left, and &lt;1,1,0&gt; is at the upper right.</p>
9797
<p class="Normal"><span class="attribute">bumpaxis</span>: If you will use a bumpmap, you need to specify a vector <span class="attribute">bumpaxis</span> direction for each vertex, specifying the direction of the &quot;x&quot; axis of the texture at that location. The default bumpaxis is vector(1,0,0).</p>
98-
<p class="Normal"><strong>Important limitation:</strong> WebGL currently supports no more than 65536 vertex objects. However, when you compound an object involving vertex objects, any vertex objects that are not used in other objects are are freed up to be re-used.</p>
9998
<p class="Normal"><strong><font color="#0000a0">Mouse picking of triangles/quads</font></strong></p>
10099
<p class="Normal">The operation <a href="mouse.html">scene.mouse.pick() </a>gives the object lying under the mouse. It may be convenient to specify my_id='car' as your own attribute for each triangle or quad in the object, so that you can tell whether the triangle or quad is part of the 'car' group:</p>
101100
<p class="program">t1 = triangle(... my_id='car')<br />

package/glow.3.2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)