Source

glowscript / docs / GlowScriptDocs / helix.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>helix</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: x-large}
.style2 {font-size: xx-large}
-->
</style>
<!-- InstanceEndEditable -->
<link href="VisualRef.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="230" height="30" border="0">
  <tr>
    <td width="66"><a name="top" id="top"></a><a href="index.html"><strong>Home</strong></a></td>
    <td width="154"><span class="Normal"><a href="primitives.html"><strong>Pictures</strong></a> of 3D objects</span></td>
  </tr>
</table>
<table width="438" height="30" border="0">
  <tr>
    <td width="151"><select id="menu1" onchange="jumpMenu(this)">
    </select></td>
    <td width="163"><select id="menu2" onchange="jumpMenu(this)">
    </select></td>
    <td width="110"><select id="menu3" onchange="jumpMenu(this)">
    </select></td>
  </tr>
</table>
<table width="454" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutDefaultTable-->
  <tr>
    <td width="454" rowspan="2" valign="top"><!-- InstanceBeginEditable name="content" -->
      <div>
        <table width="100%" border="1">
          <tr>
            <td width="77%"><div align="center"><span class="style1 style2"><font color="#0000A0">helix</font></span></div></td>
            <td width="23%"><div align="center"><img src="images/helix.jpg" alt="helix" width="131" height="127" /><a href="arrow.html"></a></div></td>
          </tr>
        </table>
        </div>
      <div>
        <p class="Normal">The following statement will display a helix that is
        parallel to the x axis (the default axis direction), with length 5 and diameter 1:</p>
        <div>
          <p class="program">var spring = helix( {pos:vec(0,2,1), <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      size:vec(5,1,1)} )</p>
          <p class="Normal">The attribute <span class="attribute">thickness</span> is the diameter of the cross section of the curve used to draw the helix; default is diameter/10.     </p>
          <p class="Normal"> Here is the rest of the attributes for a helix. All 3D objects have all of these attributes, other than arrow and curve:</p>
          <p class="attributes"> <font color="#FF0000" class="attribute">pos</font> Position: the center of one end of the helix; default = vec(0,0,0).</p>
          <p class="attributes"> <span class="attribute">size</span> The length, width, and height of the helix; default = vec(1,1,1). Changing the size does not change the thickness.</p>
          <p class="attributes"> <font color="#FF0000">axis</font> The axis points in the direction of the length of the helix, default = vec(1,0,0). Only the direction of the axis is meaningful, not its magnitude. The length of the helix is size.x, not the magnitude of the axis. </p>
          <p class="attributes"> <span class="attribute">color</span> Color of object, 
            as a red-green-blue (RGB) triple: vec(1,0,0) is the same as color.red, default = vec(1,1,1), 
            which is color.white.</p>
          <p class="attributes"><span class="attribute">up</span> Which side
            of the  helix is &quot;up&quot;; default = vec(0,1,0).</p>
          <p class="attributes"><span class="attribute">visible</span> If false, 
            
            object is not displayed; e.g. <span class="attribute">spring.visible = false</span><em class="program"><br />
              </em> Use <span class="attribute">spring.visible = true</span> to make the object 
            
            visible again.</p>
          <p class="Normal"> <strong>End vs center:</strong> The <span class="attribute">pos</span> attribute 
            for arrow, cone, cylinder, helix, and pyramid corresponds to one end of the object, 
            whereas for a box, ring, or sphere it corresponds to the center of the object. </p>
          <p class="Normal"><strong>No texture or opacity:</strong> Currently helixes cannot be transparent, it is not possible to apply a texture, and it cannot be part of a compound object.</p>
          <p class="Normal">To display a trail or an arrow along the path of a moving object, see <a href="trail.html"><strong>Attach a trail or arrow</strong></a>.</p>
      <p class="Normal">See <a href="rotation.html"><strong>Rotating an Object</strong></a> for an easy way to change the direction of an object.</p>
          <p class="Normal">When you start a  program, for convenience GlowScript 
            creates a <a href="display.html">canvas</a> on the web page and names it <span class="attribute">scene</span>. 
          Objects that you create are drawn on this canvas. If you have more than one canvas, you can specify  in which canvas to place a new object, as in box( {canvas:myscene} ).</p>
    <!-- InstanceEndEditable --></td>
  </tr>
</table>
<p><a href="#top"><strong>Top of page</strong></a></p>
</body>
<script type="text/javascript" language="javascript" src="navigation.js"></script>
<!-- InstanceEnd --></html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.