I am having a program in opengl es, in which a cube is getting rotated on user-touch along X,Y,Z axis.
Now I want to implement panning feature for the same (when user touches the cube with atleast 2 fingers–it wil get panned along the axis)…
Please anyone suggest me where do I start, I have searched too much on google stil unable to find any satisfactory example.
My code is similar to the code in API demos application which is by default installed on the emulator in which a cube is shown.
Panning can refer to a number of different things in a 3D context, but in general you’re just going to be moving the camera around. This is just a matter of how you set up your modelview matrix; I recommend using some sort of ‘lookat’ function to calculate this, and simply change your eye coordinate.
For the most natural panning, the coordinate should be modified by multiplying your screenspace displacement vector by your existing modelview matrix with w=0, and add the resulting vector to your eye coordinate.