- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Public Con structors
Matrix ()
Create an identity matrix
Matrix (Matrix src)
Create a matrix that is a (deep) copy of src
2:53am
XEngine
旋转
void setRotate (float degrees)
voidSet the matrix to rotate about (0,0) by the specified nu mber of degrees.
void
setRotate (float degrees, float px, float py)
Set the matrix to rotate by the specified number of degrees, with a pivot point at
围绕点px, py旋转degrees度,如果没设置坐标,默认以0,0点旋转.
例子:setRotate(45, 180, 120);
2:54am
缩放,翻转
void setScale (float sx, float sy)
Set the matrix to scale by sx and sy.
void setScale (float sx, float sy, float px, float py)
Set the matrix to scale by sx and sy, with a pivot point at (px, py).
以点px,py为原点缩放>=0 1为正常大小
如果是负数,图形就会翻转
如果没设置原点坐标,默认以0,0点缩放(如果发现图片不见了,检查一下是不是 翻转出了屏幕)
左右翻转并缩放到一半大小例子:setScale(-0.5f, 1,180, 120); //
左右翻转并缩放到一半大小
XEngine
倾斜
void setSkew (float kx, float ky, float px, float py)
Set the matrix to skew by sx and sy, with a pivot point at (px, py).
void setSkew (float kx, float ky)
Set the matrix to skew by sx and sy.
以点px,py为原点倾斜如果没有设置原点,则以0,0点为原点.
例子:setSkew(0, 1, 180, 120); //Y 方向拉伸
坐标
void setTran slate (float dx, float dy)
Set the matrix to tra nslate by (dx, dy).
是图片移动到某一个位置
注意
Matrix中带有pre, post的函数需要考虑先后顺序
例如:想要旋转45度,然后平移到100,100的位置需要
Java代码口
Matrix matrix = new Matrix();
matrix.postRotate( 45);
matrix.postTranslate( 100, 100);
或者
Java代码门
Matrix matrix = new Matrix();
matrix.setTranslate( 100, 100);
matrix.preRotate( 45);
这就要考虑到矩阵的前乘和后乘了 ,不然的话你会发现可能坐标位置不是你想要 的,可能图像都不见了 .
如果在复杂一些,需要选择,缩放,倾斜同时起作用,并且还要设置坐标到屏幕指 定位置你会发现很麻烦,需要自己计算出各个方法的参数,然后考虑调用的先后 顺序.
但这里有一种更简便的方法,叫系统帮我们计算
boolea n
setConeat ( Matrix a, Matrix b)
Set the matrix to the eon eate nati on of the two specified matrices, retur ning tru
这个方法的意思是帮我们把两个 Matrix对象计算并连接起来
这样的话我们就可以这样使用了
Java代码Tj
Matrix mRotateMatrix = new Matrix(); //
Matrix mScaleMatrix = new Matrix(); //
Matrix mSkewMatrix = new Matrix(); //
Matrix mPosMatrix = new Matrix(); //
Matrix mMatrix = new Matrix(); //
6.
控制旋转
控制缩放
控制倾斜
控制坐标 合并
mMatrix.setConcat(mRotateM
您可能关注的文档
最近下载
- 熔融盐理论与应用.pdf
- 2024水利闸门自动化系统技术规范.docx VIP
- 人教版英语七年级下册Unit 6 Rain or Shine单元分层作业.docx
- 【MOOC】《通信电子线路》(华中科技大学)章节作业中国大学慕课答案.docx
- 宣布干部任命后领导总结性讲话1400字.docx VIP
- Tengen天正TGW45系列万能式断路器TGW45说明书 2000 3200旋转排20230421用户手册.pdf
- 新能源汽车电学基础与高压安全 课件 项目六 任务6.2 高压下电标准流程操作要求 (1).pptx
- 克令吊管理及故障排除.doc VIP
- 煤炭储运项目环境影响报告表.docx VIP
- 设备主管述职报告与工作总结.docx VIP
原创力文档


文档评论(0)