Rotating a circle with touch?

Problems with Canvas, OpenGL, etc...

Rotating a circle with touch?

Postby Legend » Sun Jul 18, 2010 1:40 am

I am not a graphics designer so I am not quite able to get my head around canvases and paints. I would really love if someone could point me in the right direction. I am trying to rotate a circle using touch (more like a spinning wheel based on the velocity of the fling). I started off creating a custom view called "Circle" and then added a listener for touch events. I am able to get the X and Y coordinates but I am not able to rotate the circle properly.

PS: The circle I am talking about here is a graphic image. Any suggestions are greatly appreciated.
Legend
Junior Developer
Junior Developer
 
Posts: 12
Joined: Tue Sep 29, 2009 1:04 am

Top

Re: Rotating a circle with touch?

Postby mb_zi » Mon Aug 02, 2010 2:50 am

If you were to do this in a surface view and use OpenGL Es then a simple glRotate() command will rotateyour image for you for the desired effect. However you'll have to calibrate areas around the wheel to give some sort of sensitivity (aka increase or decrease agnle for the rotate command).
mb_zi
Junior Developer
Junior Developer
 
Posts: 17
Joined: Sat Feb 27, 2010 2:16 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 1 guest