I have a cube in my OpenGL view which I can rotate when I touch outside of the cube. Now I can detect which side of the cube I touch and now I'm trying to find out towards what side the touch movement is going. So if I touch the top side, the movement can go towards LEFT, RIGHT, FRONT or BACK side of the cube. The cube's orientation can be anything when doing this.
so after figuring that out I'd make it rotate around the correct axis.
I just need an idea of how to implement this.
EDIT: Here's a crude example of what I'm trying to do. Sorry, I'm bad at explaining.
the green thing is a finger touching the red side. The arrow shows the direction the finger is moving. Since it's moving towards the blue side (2), it should return 2. If it moved towards the green side (1), it would return 1 and so on.
