Hi folks,
I’m writing an app where the user can rotate a 3D object by touching and dragging on screen, and I’m having an odd problem with there being quite a bit of lag between starting the drag and the rotation of the object actually changing.
It seems like the way Unity is handling the touch is that if the movement is below some threshold it says there has been no movement, and after you drag a bit further, the position jumps and causes a jump in the object’s rotation too. I’m using iPhoneInput.touches[0].deltaPosition.
Is there a way to get the raw position data for the touch without this minimum movement threshold causing it to not move?
I think the problem comes from the iPhone itself. You don’t get a move event until a certain threshold is reached, presumably so you can more easily detect when a touch stays in the same place.
That’s what I thought, and there doesn’t seem to be a way around it. I just launched a couple 3D apps and they had this problem with rotation as well. However, given that I didn’t notice it, I don’t think it will be too much of an issue in my app. It’s just annoying that there doesn’t seem to be anything you can do about it.
However, when I release the touchscreen without moving my finger, it always rotates the model a little bit. It seems to give the actual position of the finger on release even when it’s within this threshold… Now I’m confused.
I take that back… I just checked the modern combat sandstorm demo, and it does not seem to have this delay, or if it does, it’s smaller.
I wonder if there’s something we can change in AppController.mm…
What frame rate are you running at? I noticed a several wierd things happening in my app once my frame rate got too low.
There are only a about a hundred polys in the scene and I’m not doing any special shader processing or anything. It’s definitely being caused by something in the iPhone SDK using some threshold of minimum movement and returning the same coordinates as the start of the touch instead of including the small change in position.
I have a couple of other apps that also definitely have this same problem: Solid Dots Free, and SculptMaster 3D Free.
I downloaded the demo of Modern Combat, and it actually does have this problem. Tap and drag your finger slowly, and your aim won’t change until you move your finger about 3 millimeters.