Packageorg.papervision3d.core.geom
Classpublic class Face3D

The Face3D class lets you render linear textured triangles. It also supports solid colour fill and hairline outlines.



Public Properties
 PropertyDefined by
  id : Number
The object where the face belongs.
Face3D
  id : Number
[read-only] Unique id of this instance.
Face3D
  materialName : String
A material id TODO
Face3D
  screenZ : Number
[read-only] The average depth (z coordinate) of the transformed triangle.
Face3D
  uv : Array
A MaterialObject3D object that contains the material properties of the back of a single sided triangle.
Face3D
  uv : Array
An array of {x,y} objects for the corresponding UV pixel coordinates of each triangle vertex.
Face3D
  vertices : Array
An array of Vertex3D objects for the three vertices of the triangle.
Face3D
  visible : Boolean
[read-only] A Boolean value that indicates that the face is visible, i.e.
Face3D
Public Methods
 MethodDefined by
  
Face3D(vertices:Array, materialName:String = null, uv:Array = null)
The Face3D constructor lets you create linear textured or solid colour triangles.
Face3D
  
render(instance:DisplayObject3D, container:Sprite):Number
Draws the triangle into its MovieClip container.
Face3D
  
transformUV(instance:DisplayObject3D = null):Object
Applies the updated UV texture mapping values to the triangle.
Face3D
Property detail
idproperty
public var id:Number

The object where the face belongs.

idproperty 
public var id:Number

[read-only] Unique id of this instance.

materialNameproperty 
public var materialName:String

A material id TODO

screenZproperty 
public var screenZ:Number

[read-only] The average depth (z coordinate) of the transformed triangle. Also known as the distance from the camera. Used internally for z-sorting.

uvproperty 
public var uv:Array

A MaterialObject3D object that contains the material properties of the back of a single sided triangle.

uvproperty 
public var uv:Array

An array of {x,y} objects for the corresponding UV pixel coordinates of each triangle vertex.

verticesproperty 
public var vertices:Array

An array of Vertex3D objects for the three vertices of the triangle.

visibleproperty 
public var visible:Boolean

[read-only] A Boolean value that indicates that the face is visible, i.e. it's vertices are in front of the camera.

Constructor detail
Face3D()constructor
public function Face3D(vertices:Array, materialName:String = null, uv:Array = null)

The Face3D constructor lets you create linear textured or solid colour triangles.

Parameters
vertices:Array — An array of Vertex3D objects for the three vertices of the triangle.
 
materialName:String (default = null) — A MaterialObject3D object that contains the material properties of the triangle.
 
uv:Array (default = null) — An array of {x,y} objects for the corresponding UV pixel coordinates of each triangle vertex.
Method detail
render()method
public function render(instance:DisplayObject3D, container:Sprite):Number

Draws the triangle into its MovieClip container.

Parameters
instance:DisplayObject3D — The default MovieClip that you draw into when rendering.
 
container:Sprite — A Boolean value that indicates whether random coloring is enabled. Typically used for debug purposes. Defaults to false.

Returns
Number — The number of triangles drawn. Either one if it is double sided or visible, or zero if it single sided and not visible.
transformUV()method 
public function transformUV(instance:DisplayObject3D = null):Object

Applies the updated UV texture mapping values to the triangle. This is required to speed up rendering.

Parameters
instance:DisplayObject3D (default = null)

Returns
Object