简体   繁体   中英

rotate rect in android 2d graphics?

i want to rotate a rect(not only draw rotated rect but get the new rotated value ) in android,i tried

canvas.rotate

but it didn't reflect the new values on the rect its just draw a rotated rec.

And this is not helping me because i used the rect in collision detection

Is there a way to rotate the model of the rect not only draw a rotated one?

Thanks

i agree with grWEn, try using opengl-es. you can read this blog, it really helped me. Here: http://blog.jayway.com/2010/01/01/opengl-es-tutorial-for-android-%E2%80%93-part-iii-%E2%80%93-transformations/

openGL ES is a very good library to Android graphics. Rotate a shape is very easy with glRotateF. You can find a couple of very useful openGL ES tutorial on the web. This kind of stuff is in basic tutorial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM