Class: OrthoPrimitive

OrthoPrimitive

new OrthoPrimitive()

DepthJS utlizes CreateJS's affine transformations to simulate 3D. Therefore the transformations on the objects are technically orthographic, but their positions in 3D space represent non-orthographic rendering. This creates a nice 3D effect even with just affine transformations...but leads to edges not fully lining up on things, etc. To make something as precise as a primitive you'd need to render the children of that primitive (i.e. the faces) completely orthographically. That's what the OrthoPrimitive class does. It takes OrthoFaceShape and OrthoFaceContainer class objects as children (which correspond in functionality with the Shape3D and Container3D classes) and renders them orthographically allowing you to set up as precise primitives. They also z-sort as their own display list, meaning children of the OrthoPrimitive only z-sort against each other. The OrthoPrimitive itself then z-sorts against other objects on stage as a whole. That way other 3D elements are either completely in front of or behind it, not splitting its faces.

Its functionality is no different than any Group3D object except that it takes events normally (unline Group3D elements). Add children, remove them, etc (as long as they're OrthoFaceShape and OrthoFaceContainer class objects). The difference is that you can be precise about those children's placement and build primitives out of them.

See createjs.Container to understand the properties, methods, and events it inherits from createjs.Container.
Source:

Extends

Members

rotX :Number

The rotX property sets the x-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

rotY :Number

The rotY property sets the y-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

rotZ :Number

The rotY property sets the y-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

stage3D :Stage3D

Each DisplayObject3D has a stage3D property that allows it to tell which stage it is currently in the display list of. Is null when not in a display list.
Type:
Inherited From:
Default Value:
  • null
Source:

transform3D :Transform3D

Contains the DipslayObject3D's local and global transform data.
Type:
Inherited From:
Source:

x :Number

The x property sets the x coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

y :Number

The y property sets the y coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

z :Number

The z property sets the z coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

Methods

addChild(obj)

addChild allows objects to be added to this OrthoPrimitive. addChild may take a singular value to add or may be given many such as instance.addChild(one, two, three, four);
Parameters:
Name Type Description
obj The object to be be added.
Source:
Returns:
Returns the object that was added, or the last that was added if multiple were added at once.

removeChild(obj) → {Boolean}

removeChild allows objects that were added via addChild to be removed. removeChild may take a singular value to remove or may be given many such as instance.removeChild(one, two, three, four);
Parameters:
Name Type Description
obj The object that has been added and is to be removed.
Source:
Returns:
Returns a Boolean value for if the object was removed (false if it was not in the display list to be removed), or the result for the last that was removed if multiple were removed at once.
Type
Boolean