开发者

AffineTransform linear interpolation

Given 2 java AffineTransform items, how can I interpolate between them. I need the image on screen to slowly move from the position/rotation/scale with one matrix applied, to the other.

Preferably this should be reasonably efficient since it's running every time a game draws.

My current (really hacky) solution开发者_StackOverflow社区 is to getTranslate() from both matrices, lerp between them, and then create a new matrix (This doesn't work fully, since there is no equivalent for rotation)


Get the affine matrixes of each transform via getMatrix(). Step through the interpolation of one matrix to the other, creating a new transform via AffineTransform(float[] matrix) at each step.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜