flash.display

# GraphicsTrianglePath - AS3

Package | flash.display
Class | public final class GraphicsTrianglePath
Inheritance | GraphicsTrianglePath Object
Implements | IGraphicsPath, IGraphicsData

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Defines an ordered set of triangles that can be rendered using either (u,v) fill coordinates or a normal fill. Each triangle in the path is represented by three sets of (x, y) coordinates, each of which is one point of the triangle.

The triangle vertices do not contain z coordinates and do not necessarily represent 3D faces. However a triangle path can be used to support the rendering of 3D geometry in a 2D space.

Related API Elements

flash.display.Graphics.drawTriangles()

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | culling : String Specifies whether to render triangles that face in a given direction. | GraphicsTrianglePath
|  | indices : Vector.<int> A Vector of integers or indexes, where every three indexes define a triangle. | GraphicsTrianglePath
|  | uvtData : Vector.<Number> A Vector of normalized coordinates used to apply texture mapping. | GraphicsTrianglePath
|  | vertices : Vector.<Number> A Vector of Numbers where each pair of numbers is treated as a point (an x, y pair). | GraphicsTrianglePath

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | GraphicsTrianglePath(vertices:Vector.<Number> = null, indices:Vector.<int> = null, uvtData:Vector.<Number> = null, culling:String = "none") Creates a new GraphicsTrianglePath object. | GraphicsTrianglePath
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### culling

property

`culling:String`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Specifies whether to render triangles that face in a given direction. Used to prevent the rendering of triangles that cannot be seen in the current view.

Can be set to any value defined by the TriangleCulling class.

Implementation
`public function get culling():String`
`public function set culling(value:String):void`

Related API Elements

flash.display.TriangleCulling

### indices

property

`public var indices:Vector.<int>`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

A Vector of integers or indexes, where every three indexes define a triangle. If the indexes parameter is null then every three vertices (six x,y pairs in the vertices Vector) defines a triangle. Otherwise each index refers to a vertex, which is a pair of numbers in the vertices Vector. For example `indexes[1]` refers to (`vertices[2]`, `vertices[3]`).

### uvtData

property

`public var uvtData:Vector.<Number>`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

A Vector of normalized coordinates used to apply texture mapping. Each coordinate refers to a point on the bitmap used for the fill. There must be one UV or one UVT coordinate per vertex.

In UV coordinates, (0,0) is the upper left of the bitmap, and (1,1) is the lower right of the bitmap.

If the length of this vector is twice the length of the `vertices` vector then normalized coordinates are used without perspective correction.

If the length of this vector is three times the length of the `vertices` vector then the third coordinate is interpreted as 't', the distance from the eye to the texture in eye space. This helps the rendering engine correctly apply perspective when mapping textures in 3D.

### vertices

property

`public var vertices:Vector.<Number>`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

A Vector of Numbers where each pair of numbers is treated as a point (an x, y pair).

Constructor Detail

### GraphicsTrianglePath

()
Constructor

`public function GraphicsTrianglePath(vertices:Vector.<Number> = null, indices:Vector.<int> = null, uvtData:Vector.<Number> = null, culling:String = "none")`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a new GraphicsTrianglePath object.

Parameters

| `vertices:Vector.<Number>` (default = `null`)`` — A Vector of Numbers where each pair of numbers is treated as a point (an x, y pair). Required.
| `indices:Vector.<int>` (default = `null`)`` — A Vector of integers or indexes, where every three indexes define a triangle.
| `uvtData:Vector.<Number>` (default = `null`)`` — A Vector of normalized coordinates used to apply texture mapping.
| `culling:String` (default = "`none`")`` — Specifies whether to render triangles that face in a given direction. Used to prevent the rendering of triangles that cannot be seen in the current view. Can be set to any value defined by the TriangleCulling class.

Related API Elements

culling
flash.display.TriangleCulling

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00