GithubHelp home page GithubHelp logo

Comments (5)

ivanpopelyshev avatar ivanpopelyshev commented on May 24, 2024

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.

djmisterjon avatar djmisterjon commented on May 24, 2024

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.
image

from pixi-projection.

ivanpopelyshev avatar ivanpopelyshev commented on May 24, 2024

Oh.. then maybe its possible. I will think about it.

from pixi-projection.

djmisterjon avatar djmisterjon commented on May 24, 2024

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.

djmisterjon avatar djmisterjon commented on May 24, 2024

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.
3dbone3eat_optimize
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.