Start a new topic

3D Model scaling not working on Android SDK

3D Model scaling not working on Android SDK


Thanks I will use the link given above :)

 

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.

Best regards

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

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
 

We are using SDK 4.0.3 on Android and 4.0.2 on iOS

thnx

Hello 

We noticed that the functions for scaling 3D models in the Android SDK are not functional.

Same functions used in the iOS SDK are working however when being used in the Android SDK, it doesn work.

 

Here are the functions:

 

----------

document.getElementById(World.interactionContainer).addEventListener('gesturestart', World.handleGestureStart, false);

document.getElementById(World.interactionContainer).addEventListener('gesturechange', World.handleGestureChange, false);

document.getElementById(World.interactionContainer).addEventListener('gestureend', World.handleGestureEnd, false);

---------

----------

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 
Login or Signup to post a comment