Home | Pictures of 3D objects

ring |
The following statement creates a ring centered at location vec(3,0,1), with its axis pointing in the vec(0,1,0) direction, and with a thickness in that direction of 0.2 and a diameter of 1: ring( pos=vec(3,0,1), axis=vec(0,1,0), size=vec(0.2,1,1) ) Here is a full list of attributes for a ring. All 3D objects have all of these attributes, other than arrow (which has axis_and_length instead of axis): pos Position: the center of one end of the ring; default = vec(0,0,0). size The length, width, and height of the ring; default = vec(0.1,1,1), where size.x is the thickness of the ring. axis The axis points in the direction of the length of the ring, default = vec(1,0,0). Only the direction of the axis is meaningful, not its magnitude. The length of the ring 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 ring is "up". visible If False, object is not displayed; e.g. myring.visible = False Use myring.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. To display a trail or an arrow along the path of a moving object, see Attach a trail or arrow. No texture or opacity: Currently rings, like curve, cannot be transparent, it is not possible to apply a texture, and it cannot be part of a compound object. See Rotating an Object for an easy way to change the orientation of an object. When you run 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); in JavaScript this would be box( {canvas:myscene} ). If you don't specify a canvas, the new object goes into the most recently created canvas, or the most recently selected canvas as specified by setting canvas.selected. JavaScript See the cylinder documentation for how to create an object in JavaScript.

Top of page