- Home /
Why do game objects look skewed during device rotation
During rotation of the mobile device, the objects in the scene look skewed. Furthermore, they look as if they had a different size afterwards (I guess that's due to the projectionMatrix of the cam adjusting to the changed aspect).
Any hints on what I might be doing wrong? I tried to detect device rotation and adjust the camera's fieldOfView but I can't seem to find the right factor - apart from that the skewing during the rotation still looks odd.
Can you detail what you mean by "out"?
The used cam's aspect value changes automatically from 1.33333 in landscape to 0.75 in portrait, but I don't see why I should change that.
I don't quite understand what you exactly mean. Could you perhaps post some screenshots or elaborate a bit?
Sorry for not doing that right away - I attached two screenshots now. Unfortunately I can't take screenshots during device rotation.
$$anonymous$$ight sound stupid but I held a ruler to my screen and tbh width and height matches on both :D
What I do notice is that the bottom image looks darker and so the extra shadow might be throwing you off visually.
Not sure if you misunderstood me. I wasn't saying the spheres on the screenshots are skewed - the only look skewed during device rotation (of which I can't do a screenshot). That's part 1) of my problem. Part 2) is that the sphere is appearing with different sizes -
If I use a ruler and make sure that the Portrait.Height = Landscape.Width (and height accordingly), I get the following results (in my case on $$anonymous$$ac OS X, the PDF viewer would scale the portrait image differently than the landscape one): Portrait: 12,4cm x 12,4cm Landscape: 9,5cm x 9,5cm
Part 1) Device rotation animation: There's probably not a whole lot of control for how your screen appears during device rotation. The rotation animation is not something that's supposed to be part of the game. It's also implemented by the device's OS. Out of curiosity, why do you care about what happens during the 1 sec of device rotation?
Part 2) Scaling in landscape vs portrait: It looks like you're implementing fixed-height aspect ratio. Basically, the ball's height is, for example, 40% of the screen's height. When rotated, the new height is larger. Check this thread for more info: http://gamedev.stackexchange.com/questions/79546/how-do-you-handle-aspect-ratio-differences-with-unity-2d
Total shot in the dark here: I've often seen objects become skewed during rotations dues to incorrect hierarchy layout. (usually with some uneven scaling in there, being applied to a rotation).
Also, you mentioned you change the FOV on the camera. This I don't understand: why are you not adjusting the camera's position and orientation ins$$anonymous$$d? This is how I would make the camera rotate around my object. I just don't see what the field-of-view, has to do with this,
I'm currently using the fieldOfView to implement zoom. The cam is rotating on a fixed distance around that sphere.
Of course I can work with the camera's position ins$$anonymous$$d, but then I'd have to find the right adjustment (after rotation) all the same.
Using field of view to implement zoom is going to lead to odd visual artifacts like fish-eye lens, and.. well whatever the opposite of that is.. tunnel-vision? (you can CO$$anonymous$$BINE a translation zoom, and FOV zoom (a little) for cool effects: https://en.wikipedia.org/wiki/Dolly_zoom)
I'm not sure exactly what you mean about "the right adjustment". If you rotate you camera around the sphere, keeping it pointed at the sphere, and at a constant distance: the ONLY change you would see (for a sphere), is change in the shadows. The size of there sphere on screen would remain constant.
Perhaps you want the sphere to be a specific faction of the screen size, when finished with your zoom? That is certainly computable, and would USE(but not change) the FOV in the computation: let me know if that's what your looking for before I go into more details.
Answer by king_opping · Sep 06, 2017 at 03:36 AM
Hi, i found same problem with you. and until now i cant figure how it happens avatar @fschneider
-------update------- for this i cannot force it to have some scale, but what i do then is lock the rotation of the device, so it wont change the orientation.