IMG rotation by 180 degrees differences in hardware vs simulator #414
Replies: 3 comments
-
Adding a demo project. It's just a horizontal line that's shifted between 0 and 180 degrees rotation on a timer. There's an even and an odd width line that can be toggled between by a button. You should be able to see that in the simulator, the even line "dances" very slightly up and down, but it is steady on hardware. Conversely, on hardware, the odd line will "dance" very slightly up and down, but it will be steady in the simulator. (The odd line dancing on hardware is subtle but it's there.) |
Beta Was this translation helpful? Give feedback.
-
Adding an updated project for API v3. This does work on my Active 2 Premium, but not via zeus preview. Seems like zeus preview is missing the premium device sources. |
Beta Was this translation helpful? Give feedback.
-
Here's another very interesting test:
The image at 0 degrees will look normal. At any of the other rotations, the image will be severely distorted. Basically it seems like pixels are getting blurred together. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It appears to me like the simulator and hardware behave very differently for 180 degree rotations when you zoom in on individual pixels. The differences is that for the image to be symmetric, the image on hardware must have an even number of pixels, but the image in the simulator must have an odd number of pixels. Let me explain.
Let's start with how an image an even number of pixels wide behaves. Let's say we have this image to start. You can see it's 10x10 pixels
Now let's rotate it on hardware with center_x = 5. We'll get this:

This is great, because it's symmetic. The arrow is still centered horizontally.
If we try to do the same thing in the simulator, we'll get either this:

or this

depending on whether center_x is 4 or 5. As you can see the arrow shape is no longer centered horizontally and there's no way to make it centered.
Similarly, we have the opposite situation for odd width images. If we start with this image that's 11x11 pixels:

We can rotate it by 180 degrees with center_x=5 in the simulator:

This is nice and symmetric now in the simulator when before the even one wasn't.
Now if we go on hardware, we get either this:

or this:

Depending on whether center_x is 4 or 5. Clearly not symmetric and no way to make it symmetric.
In my opinion, the simulator should behave like hardware because
Beta Was this translation helpful? Give feedback.
All reactions