nikolas Posted November 12, 2020 Share Posted November 12, 2020 I have a PIXI.Container object that I need to scale straight up-and-down, by the Y axis of the camera. The object itself is rotated, so I don't want to scale by local co-ordinates. This will scale the object by local co-ordinates: container.scale.y = scaleFactor; How do I scale it by global coords by this scale factor? I'm assuming I can use `container.worldTransform` somehow, but I don't understand how to use this. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 13, 2020 Share Posted November 13, 2020 transform affects only local coord matrix. the resulting worldTransform is "parent.transform.worldTransform * this.transform.localTransform". There's no way to do your thing in vanilla pixijs. However, you can hack the transform like i do here: https://github.com/pixijs/pixi-projection/blob/master/src/base/LinearProjection.ts#L2 just set "transform.updateTransform = transformHack", where transformHack is your own update function based on https://github.com/pixijs/pixi.js/blob/dev/packages/math/src/Transform.ts#L227 Alternatively, you can scale before rotation is applied by combining two containers: one for scale outside, one for rotation inside. nikolas 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.