You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I uncomment the following codes to prevent head tilt:
GLKQuaternion q = GLKQuaternionFromTwoVectors(touchVector, nowVector);
//_offsetMatrix = GLKMatrix4Multiply(_offsetMatrix, GLKMatrix4MakeWithQuaternion(q));
// in progress for preventHeadTilt
GLKMatrix4 mat = GLKMatrix4Multiply(_offsetMatrix, GLKMatrix4MakeWithQuaternion(q));
_offsetMatrix = GLKMatrix4MakeLookAt(0, 0, 0, -mat.m02, -mat.m12, -mat.m22, 0, 1, 0);
when I pan around the scene directly up or down(i.e. abs(mat.m02) is close to 1), the scene will shake. I try to solve this problem by changing the codes as following:
if (fabs(mat.m02) < 0.8) {
_offsetMatrix = GLKMatrix4MakeLookAt(0, 0, 0, -mat.m02, -mat.m12, -mat.m22, 0, 1, 0);
}
but I think this solution is ugly, and I want to know how to avoid scene jitter more effectively?
Thanks a lot
The text was updated successfully, but these errors were encountered:
I removed the jitter by removing the first _offsetMatrix assignment: GLKVector3 nowVector = [self vectorFromScreenLocation:[sender locationInView:sender.view] inAttitude:_offsetMatrix]; GLKQuaternion q = GLKQuaternionFromTwoVectors(touchVector, nowVector); // in progress for preventHeadTilt GLKMatrix4 mat = GLKMatrix4Multiply(_offsetMatrix, GLKMatrix4MakeWithQuaternion(q)); _offsetMatrix = GLKMatrix4MakeLookAt(0, 0, 0, -mat.m02, -mat.m12, -mat.m22, 0, 1, 0);
However, when you pan to the bottom of the image it goes a little crazy. Do you have any idea Robby? Awesome piece of work by the way, great implementation of the panoramic view :)
Hello,
thanks for your great codes.
I uncomment the following codes to prevent head tilt:
GLKQuaternion q = GLKQuaternionFromTwoVectors(touchVector, nowVector);
//_offsetMatrix = GLKMatrix4Multiply(_offsetMatrix, GLKMatrix4MakeWithQuaternion(q));
// in progress for preventHeadTilt
GLKMatrix4 mat = GLKMatrix4Multiply(_offsetMatrix, GLKMatrix4MakeWithQuaternion(q));
_offsetMatrix = GLKMatrix4MakeLookAt(0, 0, 0, -mat.m02, -mat.m12, -mat.m22, 0, 1, 0);
when I pan around the scene directly up or down(i.e. abs(mat.m02) is close to 1), the scene will shake. I try to solve this problem by changing the codes as following:
if (fabs(mat.m02) < 0.8) {
_offsetMatrix = GLKMatrix4MakeLookAt(0, 0, 0, -mat.m02, -mat.m12, -mat.m22, 0, 1, 0);
}
but I think this solution is ugly, and I want to know how to avoid scene jitter more effectively?
Thanks a lot
The text was updated successfully, but these errors were encountered: