I am currently working on a 3D model viewer for Android using OpenGL-ES. I want to create a rotation effect according to the gesture given. I know how to do single-axis rotation, such as rotate solely on the x-, y- or z-axis. However, my problem is that I don't know how to combine them all 3 together and have my app know in which axis I want to rotate depending on the touch gesture. Gestures I have in mind were:
- Swipe up/down for x-axis
- Swipe left/right for y-axis
- swipe in circular motion for z-axis
How can I do this?
EDIT: I found out that 3 types of swipes can make the moment very ugly. Therefore what I did was remove the z-axis motion. After removing that condition, I found that the other 2 work really well in conjunction with the same algorithm.