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
  face3DInstance : Face3DInstance
The transformed Face3DInstance
Face3D
  faceNormal : Number3D
The face normal
Face3D
  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
  v0 : Vertex3D
Used to store references to the vertices.
Face3D
  v1 : Vertex3D
Face3D
  v2 : Vertex3D
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
Protected Methods
 MethodDefined by
  
createNormal():void
Face3D
Property detail
face3DInstanceproperty
public var face3DInstance:Face3DInstance

The transformed Face3DInstance

faceNormalproperty 
public var faceNormal:Number3D

The face normal

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.

v0property 
public var v0:Vertex3D

Used to store references to the vertices.

v1property 
public var v1:Vertex3D
v2property 
public var v2:Vertex3D
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
createNormal()method
protected function createNormal():void
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.