Here is the rendering code:
I have in mind that you render your scene without translating it when handling pinch gesture.
glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); glLoadIdentity(); float scale = view->getScale(); CGPoint target = view->getTarget(); glTranslatef(target.x, target.y, 0); glScalef(scale, scale * aspectRatio, 0); glTranslatef(-target.x, -target.y, 0); renderScene(); glPopMatrix(); renderUI();As you can see, i translate to the target position, scale and translate back. No explicit translation handled.
Whoops, it is possible. Thank you, i`ll fix it right now.
Could it be that getScale() returns 1 and you get a division by zero in your touchesMoved routine ?
Yes, they behave correct. In fact, my puzzle is already released on iPAD, but I cannot pass QA to release it on iPhone because they demand swiping up and down with initial scale
Did you console log all your scale and translation values to see if they behave in correct way?