# glowscript / docs / GlowScriptDocs / helix.html

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86``` ``` helix
Home Pictures of 3D objects
helix

The following statement will display a helix that is parallel to the x axis (the default axis direction), with length 5 and diameter 1:

var spring = helix( {pos:vec(0,2,1),
size:vec(5,1,1)} )

The attribute thickness is the diameter of the cross section of the curve used to draw the helix; default is diameter/10.

Here is the rest of the attributes for a helix. All 3D objects have all of these attributes, other than arrow and curve:

pos Position: the center of one end of the helix; default = vec(0,0,0).

size The length, width, and height of the helix; default = vec(1,1,1). Changing the size does not change the thickness.

axis 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.

color 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.

up Which side of the helix is "up"; default = vec(0,1,0).

visible If false, object is not displayed; e.g. spring.visible = false
Use spring.visible = true to make the object visible again.

End vs center: The pos 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.

No texture or opacity: Currently helixes cannot be transparent, it is not possible to apply a texture, and it cannot be part of a compound object.

To display a trail or an arrow along the path of a moving object, see Attach a trail or arrow.

See Rotating an Object for an easy way to change the direction of an object.

When you start a program, for convenience GlowScript creates a canvas on the web page and names it scene. 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} ).

Top of page

```
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.