Difference between revisions of "Canvas 3D - Line Tag"

From CDOT Wiki
Jump to: navigation, search
 
(Tag Attributes)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Quad Tag Reference =
+
= Line Tag Reference =
  
 
[[XML_3D_-_BTS530/630 Project|Back To XML 3D Main Page]]
 
[[XML_3D_-_BTS530/630 Project|Back To XML 3D Main Page]]
Line 5: Line 5:
 
== Introduction ==
 
== Introduction ==
  
The Line is one of the basic primitives that can be created on the fly. The Line is a 2D face that can be displayed in a 3D world. The Line Tag encompasses the various attributes that are associated with a Line, such as a start position and an end position. In addition, the Line can be textured with a predefined image from a specific location.
+
The Line is one of the basic primitives that can be created on the fly. The Line Tag encompasses the various attributes that are associated with a Line, such as a start position and an end position.
  
 
== Tag Attributes ==
 
== Tag Attributes ==
  
* name
+
* start
** '''Usage:''' <quad name="myquad" />.
+
** '''Usage:''' <line start="20, 200" />.
** The ''name'' attribute is optional. If omited, the name is not used and thus cannot be retrieved within JavaScript.
+
** The ''start'' attribute determines the start position of a line
** The Quad is given an Identifier so that It can be retrieved and modified within JavaScript.
+
** If omited, the start position defaults to the Origin location at {0, 0}.
** The name is a only accepts a string of Alpha-numeric characters.
+
* end
* position
+
** '''Usage:''' <line end="50, 200" />.
** '''Usage:''' <quad position="0.3, 5.5, 3.8" />.
+
** The ''end'' attribute determines the end position of a line. A line is then drawn from its start position to its end position.
** The ''position'' attribute is optional. If omited, the position defaults to the Origin location at {0.0, 0.0, 0.0}.
+
** ''This attribute cannot be omitted.''
** 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.
+
* fillcolor
* orientation
+
** '''Usage:''' <line fillcolor="#00FF00" />.
** '''Usage:''' <quad orientation="1.0, 1.0, 1.0" />.
+
** The ''fillcolor'' attribute sets a specific color that will be painted inside the line.
** The ''orientation'' attribute defines the direction in which the quad is facing. The direction is defined by a vector value.
+
** This value, if omitted, will default to black (#000000).
** The orientation value only accepts three numbers that are separated by commas.
+
* bordercolor
* size
+
** '''Usage:''' <line bordercolor="#FF00FF" />.
** '''Usage:''' <quad size="0.4" />.
+
** The ''bordercolor'' attribute sets a specific color of the border.
** The ''size'' attribute defines the size of the Quad on the screen.
+
** If omitted, the line will be drawn borderless.
** The size value dictates the distance each face of the quad is away from it's center point.
+
*linecap
* texture
+
**'''Usage:''' <line linecap="round" />
** '''Usage:''' <quad texture="mytexture" />
+
** The lineCap property determines how the end points of every line are drawn. There are three possible values for this property and those are: butt, round and square.
** The ''texture'' attribute contains the name identifier of a texture that is defined inside the canvas tag.
+
**By default this property is set to butt.
** If the texture does not exist or is not defined, a default color of white is applied to the Quad.
+
[[Image:Canvas_linecap.png]]
** The attribute must be Alpha-numeric and must point to a defined texture tag.
 
  
 
== Syntax ==
 
== Syntax ==
Line 36: Line 35:
 
<pre>
 
<pre>
 
<canvas>
 
<canvas>
   <line name="myline" start="10.0, 200.0" end="350.0, 200.0"></line>
+
   <line start="10, 220" end="350, 100" fillcolor="#000" linecap="butt" />
 
</canvas>
 
</canvas>
 
</pre>
 
</pre>

Latest revision as of 13:49, 10 March 2007

Line Tag Reference

Back To XML 3D Main Page

Introduction

The Line is one of the basic primitives that can be created on the fly. The Line Tag encompasses the various attributes that are associated with a Line, such as a start position and an end position.

Tag Attributes

  • start
    • Usage: <line start="20, 200" />.
    • The start attribute determines the start position of a line
    • If omited, the start position defaults to the Origin location at {0, 0}.
  • end
    • Usage: <line end="50, 200" />.
    • The end attribute determines the end position of a line. A line is then drawn from its start position to its end position.
    • This attribute cannot be omitted.
  • fillcolor
    • Usage: <line fillcolor="#00FF00" />.
    • The fillcolor attribute sets a specific color that will be painted inside the line.
    • This value, if omitted, will default to black (#000000).
  • bordercolor
    • Usage: <line bordercolor="#FF00FF" />.
    • The bordercolor attribute sets a specific color of the border.
    • If omitted, the line will be drawn borderless.
  • linecap
    • Usage: <line linecap="round" />
    • The lineCap property determines how the end points of every line are drawn. There are three possible values for this property and those are: butt, round and square.
    • By default this property is set to butt.

Canvas linecap.png

Syntax

<canvas>
  <line start="10, 220" end="350, 100" fillcolor="#000" linecap="butt" />
</canvas>

References

  • None.