We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera.rotateX/Y()修正版 如果图形没有绘制在Canvase中心, 修正后图形也不是对称的(即使我换成了一张正方形的图片)
The text was updated successfully, but these errors were encountered:
修正版 朱老师 秀了一波操作 ,修正版本的代码大致如下
camera.rotateX(30); camera.getMatrix(matrix); matrix.preTranslate(-center1X, -center1Y); matrix.postTranslate(center1X, center1Y);
这里顺序是正的 ,先使用 pre 进行 前乘 对 中心点进行设置。 然后使用使用 post 进行后乘 ,把画布又弄回来了。 你注意看看这里你是不是写错了。
pre
post
如果你对矩阵 有意图,可以查看这篇文章 如果你和我一样,数学渣的一B,矩阵完全不会,也可以用老方法(倒序) 完成。
//把 画布移动回来 canvas.translate(center1X, center1Y); camera.rotateX(30); camera.applyToCanvas(canvas); //改变中心移动 ... canvas.translate(-center1X, -center1Y);
效果也是一样的。
这个方法和前面的练习 如出一辙,我就不多解释了。
本人也是新手,若有说错之处,还请多多包涵
Sorry, something went wrong.
关于修正这块的{@code canvas.translate()}, 可以参考 {@link Canvas#rotate(float, float, float)}方法的实现
No branches or pull requests
Camera.rotateX/Y()修正版
如果图形没有绘制在Canvase中心,
修正后图形也不是对称的(即使我换成了一张正方形的图片)
The text was updated successfully, but these errors were encountered: