TriangleMesh3D

Kind of class:public class
Package:org.papervision3d.core.geom
Inherits from:Vertices3D < DisplayObject3D < DisplayObjectContainer3D < EventDispatcher
Known subclasses:
Classpath:org.papervision3d.core.geom.TriangleMesh3D
File last modified:Sunday, 02 March 2008, 15:23:39
The Mesh3D class lets you create and display solid 3D objects made of vertices and triangular polygons.

Summary


Constructor
Instance methods
  • project (parent:DisplayObject3D) : Number
    • Projects three dimensional coordinates onto a two dimensional plane to simulate the relationship of the camera to subject.
  • projectTexture (u:String = "x", v:String = "y") : void
    • Planar projection from the specified plane.
  • quarterFaces : void
    • Divides all faces into 4.
  • mergeVertices : void
    • Merges duplicated vertices.

Constructor

TriangleMesh3D

public function TriangleMesh3D (
material:MaterialObject3D, vertices:Array, faces:Array, name:String = null, initObject:Object = null)

Creates a new Mesh object.

The Mesh DisplayObject3D class lets you create and display solid 3D objects made of vertices and triangular polygons.
Parameters:
material :
A MaterialObject3D object that contains the material properties of the object.
vertices :
An array of Vertex3D objects for the vertices of the mesh.
faces :
An array of Face3D objects for the faces of the mesh.
initObject:
[optional] - An object that contains user defined properties with which to populate the newly created DisplayObject3D.

It includes x, y, z, rotationX, rotationY, rotationZ, scaleX, scaleY scaleZ and a user defined extra object.

If extra is not an object, it is ignored. All properties of the extra field are copied into the new instance. The properties specified with extra are publicly available.

  • sortFaces: Z-depth sorting when rendering. Some objects might not need it. Default is false (faster).
  • showFaces: Use only if each face is on a separate MovieClip container. Default is false.

Instance methods

mergeVertices

public function mergeVertices (
) : void

Merges duplicated vertices.

project

override public function project (
parent:DisplayObject3D, renderSessionData:RenderSessionData) : Number

Projects three dimensional coordinates onto a two dimensional plane to simulate the relationship of the camera to subject.

This is the first step in the process of representing three dimensional shapes two dimensionally.
Parameters:
camera :
Camera3D object to render from.
parent :
The DisplayObject3D object that contains this display object.
#
renderSessionData:
Data for the current render.
#
Overrides:

projectTexture

public function projectTexture (
u:String = "x", v:String = "y") : void

Planar projection from the specified plane.
Parameters:
u:
The texture horizontal axis. Can be "x", "y" or "z". The default value is "x".
v:
The texture vertical axis. Can be "x", "y" or "z". The default value is "y".

quarterFaces

public function quarterFaces (
) : void

Divides all faces into 4.