Improvement to 3D Rotation Lag
I do not know if anyone has already realized that behaviour...if you perform a manual rotation via swipe gesture there is sometimes a little lag.
This is the result of the rotation design and the iOS having to decide if a double/single tap occured. Consequently, the very first call of touchesMoved takes longer than subsequent calls. Therefore it would be better to store the very first touch location in touchesMoved and not in touchesBegan.
like
touchesBegan:
if (swipe) flag=YES; // ...swipe => [totalTouches count] ==1
touchesMoved:
if (swipe && flag) { //very first call of touchesMoved with a swipe gesture
previousLocation=[[touches anyObject] locationInView:modelView];
flag=NO;
}
else {
...execute standard code
}
If you set the previousLocation already in touchesBegan the gap between the first two coordinates is too big and rotation will result in a "jump" from one scene to another
(Actually translation and scaling shows the same behaviour...so you could apply the same technique to them as well)
I know that this is not the most elegant way to compensate the lag but well... it works! ;)
This is talked about in sessions 121, advanced gesture recognition. Fail early, fail often. I think the lag is caused by both the gestures being possible and delaying initial touches.
By the way, I love your captcha, Brad.
Interesting. I guess I hadn't noticed that, but I can easily try out the fix you've suggested. Thanks for pointing it out, along with the code.