pixijs / pixi-projection

MIT License
190 stars 34 forks source link

TilingSprite works in isometric mode but not in perspective mode #94

Closed paganaye closed 3 years ago

paganaye commented 3 years ago

I took your simple One-point with return to affine and modified it to display an issue with TilingSprite2d. Sample code with is here: https://codepen.io/paganaye/pen/abwZeam?editors=1010

As you can see in the example I have a Sprite2d and a TilingSprite2d and they don't behave the same way. The purple part displays fine in isometric mode but not perspective mode (it looks like it only support isometric mode).

I'd be happy to contribute. I had a look but it is above my level It looks like in Sprite2d you do a lot of calculations depending on whether we're in affine mode or not. In tiling sprite it doesn't seem to be the case.

ivanpopelyshev commented 3 years ago

Yep, that's a bug. I forgot to copy calculateVertices stuff most probably

ivanpopelyshev commented 3 years ago

Oh, wait, it doesnt need calculateVertices at all

ivanpopelyshev commented 3 years ago

loool. I use ts.transform.worldTransform.toArray(true) and not overriden ts.worldTransform

ivanpopelyshev commented 3 years ago

OK. https://cdn.jsdelivr.net/npm/pixi-projection@latest/dist/pixi-projection.umd.js , version 0.4.3

it works! thank you for the notice. Here is a patch: https://github.com/pixijs/pixi-projection/commit/8502b16b2aa7df421f8dd66182e9dd4a9612e923

paganaye commented 3 years ago

Bug is fixed. Excellent. https://codepen.io/paganaye/pen/abwmmqd?editors=1010