Comments (5)
With my current understanding of Bone transforms - its not possible:
https://github.com/pixijs/pixi-spine/blob/master/src/core/Bone.ts#L94
https://github.com/pixijs/pixi-spine/blob/master/src/core/IkConstraint.ts#L83
https://github.com/pixijs/pixi-spine/blob/master/src/core/PathConstraint.ts#L70
Compare that to pixi transform: https://github.com/pixijs/pixi.js/blob/dev/packages/math/src/Transform.js#L189
from pixi-projection.
ha i see, thanks.
I thought there might be hope in this area instead !
https://github.com/pixijs/pixi-spine/blob/2522be16a342749320a3e7a7455bf1fe15f16777/src/Spine.ts#L280
I tried tests but it was a bit of a mess because I do not use the typescript version.
from pixi-projection.
Oh.. then maybe its possible. I will think about it.
from pixi-projection.
otherwise it is not serious, if you see that these really too hacky or very bad for performance!, I have a slightly less attractive alternative, I could simply use the spine3d container
, perform a rotation change with eulerY
and play on the 2Dplane.
These are less effective than playing with the 3dBones, but the result is interesting.
from pixi-projection.
hum, this is the alternative am talking about without 3d bone
.
I have some difficulty quantifying automatic camera angles and environment z-index
for now but the result seem interesting.
The user case is allow some static creature to hit a target with her hitBone
from spine2d.
this is the code used from the gif, but have some bug in some context :(
const dist = $camera.getDistanceFrom(this.p, target.p);
const hitBone = this.s.skeleton.findBone('hitBone');
const zeroX = hitBone.x; // just a temp backup
this.s.state.setAnimation(3,'atk0',false,0);
this.s.state.addEmptyAnimation(3,0.2,0);
const tl = new TimelineMax();
tl.to($camera, 1, {_ang:dist.a/Math.PI,_perspective:-0.28, _zoom:0.6, ease:Power4.easeOut },0);
tl.to(this.s.euler, 1, { y:dist.a, ease: Power4.easeOut},0);
tl.to(hitBone, 0.1, {x:zeroX-(dist.d/this.s.scale3d._x), ease:Back.easeIn.config(1.2) },1.1);
tl.call(() => {
target.s.state.setAnimation(3,'hit0',false,0);
} ,null,null,'+=0.1');
from pixi-projection.
Related Issues (20)
- Pixi Projection for Graphics HOT 3
- Cannot read properties of undefined (reading 'start') HOT 2
- wrong type for Container3d : ObservablePoint3dĀ HOT 1
- typo
- orthographic camera projection
- 0.4.4 spine support HOT 4
- Importing the plugin (webpack) HOT 4
- IEuler typea need fix and to be replace by data point.
- The bug in 2D Plane
- PixiJS Deprecation Warning HOT 1
- Pixi.js v7.x & pixi-spine compatibility HOT 8
- An error occurs when using Assets.add
- README.md links broken HOT 1
- Pixi 6.1.2 - Uncaught TypeError: Cannot read property 'start' of undefined HOT 4
- TilingSprite works in isometric mode but not in perspective mode HOT 5
- Bunnies in the sky HOT 3
- pixi-projection with sprite elevations HOT 20
- How can I decide which diagonal to use ? HOT 4
- Mesh in 2d projections
- Where can i find the docs ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi-projection.