Difference between revisions of "Canvas 3D - Cube Tag"
Line 5: | Line 5: | ||
== Introduction == | == Introduction == | ||
− | The Cube is one of the basic | + | The Cube is one of the basic primitives that can be created on the fly. The Cube Tag encompasses the various attributes that are associated with a Cube, such as position, size and orientation. In addition, the Cube can be textured with a predefined image from a specific location. |
== Tag Attributes == | == Tag Attributes == | ||
Line 11: | Line 11: | ||
* name | * name | ||
** '''Usage:''' <cube name="mycube" />. | ** '''Usage:''' <cube name="mycube" />. | ||
− | ** The ''name'' attribute is optional. If | + | ** The ''name'' attribute is optional. If omited, the name is not used and thus cannot be retrieved within JavaScript. |
** The Cube is given an Identifier so that It can be retrieved and modified within JavaScript. | ** The Cube is given an Identifier so that It can be retrieved and modified within JavaScript. | ||
** The name is a only accepts a string of Alpha-numeric characters. | ** The name is a only accepts a string of Alpha-numeric characters. | ||
* position | * position | ||
** '''Usage:''' <cube position="0.3, 5.5, 3.8" />. | ** '''Usage:''' <cube position="0.3, 5.5, 3.8" />. | ||
− | ** The ''position'' attribute is optional. If | + | ** The ''position'' attribute is optional. If omited, the position defaults to the Origin location at {0.0, 0.0, 0.0}. |
** The position attribute holds a set of three floating point numbers separated by commas that are associated with the distance away from the Origin Point on the X, Y, and Z axis. | ** The position attribute holds a set of three floating point numbers separated by commas that are associated with the distance away from the Origin Point on the X, Y, and Z axis. | ||
* orientation | * orientation |
Latest revision as of 18:40, 20 October 2006
Cube Tag Reference
Introduction
The Cube is one of the basic primitives that can be created on the fly. The Cube Tag encompasses the various attributes that are associated with a Cube, such as position, size and orientation. In addition, the Cube can be textured with a predefined image from a specific location.
Tag Attributes
- name
- Usage: <cube name="mycube" />.
- The name attribute is optional. If omited, the name is not used and thus cannot be retrieved within JavaScript.
- The Cube is given an Identifier so that It can be retrieved and modified within JavaScript.
- The name is a only accepts a string of Alpha-numeric characters.
- position
- Usage: <cube position="0.3, 5.5, 3.8" />.
- The position attribute is optional. If omited, the position defaults to the Origin location at {0.0, 0.0, 0.0}.
- The position attribute holds a set of three floating point numbers separated by commas that are associated with the distance away from the Origin Point on the X, Y, and Z axis.
- orientation
- Usage: <cube orientation="1.0, 1.0, 1.0" />.
- The orientation attribute defines the direction in which the cube is facing. The direction is defined by a vector value.
- The orientation value only accepts three numbers that are separated by commas.
- size
- Usage: <cube size="0.4" />.
- The size attribute defines the size of the Cube on the screen.
- The size value dictates the distance each face of the cube is away from it's center point.
- texture
- Usage: <cube texture="mytexture" />
- The texture attribute contains the name identifier of a texture that is defined inside the canvas tag.
- If the texture does not exist or is not defined, a default color of white is applied to the cube.
- The attribute must be Alpha-numeric and must point to a defined texture tag.
Syntax
<canvas> <cube name="mycube" position="0.0, 0.3, 0.5" orientation="0.2, 0.6, 1.3" size="1.9" texture="mytexture" /> </canvas>
References
- None.