In order to edit an image using OpenGL I provided user interaction such that, as the user moves the finger the image gets edited according to drag direction .But I want to limit the dragging.For example, user should edit only some part of the nose, if dragging is not limited my image texture is getting distorted as there is chance for user to drag his/her finger all over the screen or face(more specifically) .
//here is the code
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
count++;
NSLog(@"touches moved called");
UITouch *touch = [[touches allObjects] objectAtIndex:0];
if(count>2)
{
NSLog(@"Entered");
count=0;
self.view.userInteractionEnabled=NO;
}
else{
updatepoint = [touch locationInView:self.view];
mousex = updatepoint.x;
mousey = self.view.bounds.size.height-updatepoint.y;
grab = [self ripple_grab:mousex:mousey];
[self drawFrame];
}
}
I got the solution
Here is my updated code. Please do give me suggestions if there is any other method.