Skip to content

Commit

Permalink
more readme, publish new version
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpopelyshev committed Apr 29, 2018
1 parent 4c4401b commit f71c3df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,23 @@ and projection plugin adds `position3d`, `euler`, `scale3d`, `pivot3d`. Those fi
The only exception is a `Camera3d`, that applies `projection` just after pixi fields, and then applies 3d fields in **reversed** order.
That's why it can follow elements - its transform negates the element transform.

For complex objects like `Spine` there are two ways to add them:
### Spine

1. Use corresponding class in projection lib: `PIXI.projection.spine.Spine`
2. Create `Container3d` that returns all children to 2d space: `container3d.affine = PIXI.projection.AFFINE.AXIS_X;`
There's special build `pixi-projection-spine` to support Spine objects, please browse `dist` folder.

### Heaven

No, we dont support `pixi-heaven` sprites yet.

### What if element is not supported by library?

For complex objects that are not supported by library, there is a way to add them inside the camera **If their plane is perpendicular to the camera**.

Create `Container3d` that returns all children to 2d space: `container3d.affine = PIXI.projection.AFFINE.AXIS_X;`
Any 2d elements added to that container will think of it as a simple 2d container, and custom renderers will work with it just fine.

This way is also **more performant** because **Sprite works faster than Sprite3d. 4x4 matrices ARE VERY SLOW**.

### Sorting

`pixi-projection` provides extra fields to handle sorting.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixi-projection",
"version": "0.2.0",
"version": "0.2.1",
"description": "Projections (2.5d, 3d and bilinear) for pixi v^4",
"author": "Ivan Popelyshev",
"contributors": [
Expand Down

0 comments on commit f71c3df

Please sign in to comment.