this.handleGestureStart = function handleGestureStartFn(event) {
/* Once a gesture is recognized, disable rotation changes */
World.swipeAllowed = false;
World.lastScale = event.scale;
}
this.handleGestureChange = function handleGestureChangeFn(event) {
/* Calculate the new scaling delta that should applied to the 3D model. */
var deltaScale = (event.scale - World.lastScale) * 0.1;
/* Negative scale values are not allowd by the 3D model API. So we use the Math.max function to ensure scale values >= 0. */
var newScale = Math.max(World.modelCar.scale.x + deltaScale, 0);
World.modelCar.scale = {
x: newScale,
y: newScale,
z: newScale
};
/* Keep track of the current scale value so that we can calculate the scale delta in the next gesture changed function call */
World.lastScale = event.scale;
}
this.handlelGestureEnd = function handlelGestureEndFn(event) {
/* Once the gesture ends, allow rotation changes again */
World.swipeAllowed = true;
World.lastScale = event.scale;
}
},
--------
Could you please help us fix the 3D model scale issue on Androids.
Thanks
m
maher youniss
said
about 6 years ago
We are using SDK 4.0.3 on Android and 4.0.2 on iOS
thnx
A
Andreas Fötschl
said
about 6 years ago
Hi there!
Unfortunately current demo only works on iOS but we'll check to make it also work on Android in an upcoming SDK Version.
Please have a look at some stackoverflow posts dealing with this topic so you can then forward attribute-change commands accordingly to the AR.Model.
Hope that helps & Sorry for inconvenience.
Kind regards, Andreas
T
Thibaud RENAUX
said
about 5 years ago
Hi, I'm working on an app using SDK 5.0 and zoom seems to not work on Android insted of iOS. You said "we'll check to make it also work on Android in an upcoming SDK Version." Is it still not working for Android or it's my fault ?
Thanks
A
Andreas Fötschl
said
about 5 years ago
The requested feature is still not part of the sample application but feel free to add zoom controls or implement custom controllers to adjust the AR.Model attributes the way you need it. Note that the sample application picks some usecases for demo purpose.
maher youniss