How to do good scale when snap ? I need to handle other devices than iPhone5 "the defualt"
I used AR.context.scene.globalScale = -1.0;
The tutorial say: "Setting the global scale to -1 indicates that the SDK should calculate the value by itself, so that all drawables are equal in pixel size among different devices."
But the result wasn't good, it stratched in height.
How to handle that correctly ?
Thank you,
Heba
A
Andreas Schacherbauer
said
about 8 years ago
Hi heba, The scale that is used when snapped is different than the scale that is applied when the object moves. The global scene scale is only helpful when objects are not snapped. To ensure the right scale value, calcualte the value based on your dif size which defines the snap area and apply the scale only when the objects is snapped and set it to the original value when snapping ends.
Best regards
Andreas
h
heba Muhammad
said
about 8 years ago
Hi Andreas,
Can you suggest me a correct way to calculate this scale when snap ?, I tried many ways but it's not good enough for multi devices.
Thank you,
A
Andreas Schacherbauer
said
almost 8 years ago
Do you mean different iOS/Android devices or a a mix between all of them?
Best regards
Andreas
T
Till Krempel
said
over 7 years ago
Still a problem, any news ?
N
Nicola Radacher
said
over 7 years ago
Hi Till,
Can you please provide further details on the exact issue (which SDK version is this happening with? OS version? platform? send screenshots of the behaviour)
Greetings
Nicola
h
heba Muhammad
said
over 7 years ago
Now, we use SDK 5, but the problem still there for Android devices especially and latest iOS devices like iPhone 6 (the problem is related to the resolution)
What I found after investigation is: the problem is because Wikitude depends on the SnapContainer scale (size in width and height) when snap, so SnapContainer dimentions must be as a Square shape till content can be more normal, and that is not very effective for all devices, sometimes you need to make it as a rectangle shape to cover larger area from screen especially when need interaction with touch events.
the two attached files: the first for bad scale on android, and other is for iphone which is good, this difference in results is related to the difference in devices resolutions.
I hope that helps you. Also hope Wikitude find a solution for that.
A
Andreas Schacherbauer
said
over 7 years ago
Hi heba, As you already mentioned, the snap container needs to be a square. My guess is that the different browsers (iOS, Android) do not interpret your snap container the same. can you please set a background color for your snap container and make sure that it is always a square?
heba Muhammad