virocore icon indicating copy to clipboard operation
virocore copied to clipboard

3D model rotation and zoom does not smooth?

Open tuzenvn opened this issue 5 years ago • 11 comments

I try to build ARRetail with my model like lamps and chairs but I see interactions with models (rotation and zoom) does not smooth like IOS ARToolkit. My issue sometimes conflig actions, for example when I using two fingers to rotation but model do zoom out or zoom in and when I want to scale model then that do rotation model.

tuzenvn avatar Jul 04 '18 15:07 tuzenvn

Hi @tuzenvn,

Could you let me know what device you're using for the ARRetail example? I'd like to see if I can reproduce this. Thanks.

radvani avatar Jul 05 '18 22:07 radvani

Hi @radvani ,

I use Pixel XL - OS 8.1 for testing.

Thanks.

tuzenvn avatar Jul 06 '18 09:07 tuzenvn

Hi @tuzenvn,

Sorry for the delayed response, I've attempted to reproduce this issue and am not able to using the Pixel device we have in house.

Just a note, the ARRetail app only supports single finger dragging and two finger rotating, there is no two finger scaling in that example (as a real-world furniture placing application wouldn't require that feature).

Let use know if you still have issues.

Thanks,

achuvm avatar Jul 30 '18 18:07 achuvm

@achuvm What if I want to have smooth 3D scaling and rotating in my AR application? Is it possible to achieve that?

HLneoh avatar Sep 04 '18 18:09 HLneoh

@HLneoh,

Check out the code for two-finger scaling/rotation in our open source Figment App: https://github.com/viromedia/figment-ar

You can install the app and test it for yourself from the Play Store or App Store.

achuvm avatar Sep 04 '18 18:09 achuvm

@achuvm Thanks for the comment. However, figment AR used viro react and react native to implement the feature. May I know is it possible to use viro core (Java) to achieve that?

HLneoh avatar Sep 04 '18 18:09 HLneoh

Hi @HLneoh,

Yes, you can use very similar logic (unfortunately we don't have a published example of this) through the use of the GesturePinchListener and the GestureRotateListener.

Let us know if you cant get it to work!

achuvm avatar Sep 04 '18 18:09 achuvm

@achuvm Yes, I am able to achieve that. However, I cannot get a smooth rotating and scaling. My issue sometimes conflig actions, for example when I using two fingers to rotation but model do zoom out or zoom in and when I want to scale model then that do rotation model.

HLneoh avatar Sep 04 '18 18:09 HLneoh

Hi @HLneoh,

Hmm, that sounds like an issue with the callbacks if the rotating and pinch gestures are being mis-characterized by the callbacks. We'll have to take a look at this and fix any issues in a future release.

In the meantime, you can add your own OnTouchListener by calling setOnTouchListener() on ViroViewARCore. That way you can use any public code out there to process Android touch events. These will compute 2D coordinates so you may need a way for the user to tell you which object should be rotated/scaled.

Thanks,

achuvm avatar Sep 04 '18 19:09 achuvm

Hey @HLneoh, as Andy mentioned, you can add your own OnTouchListener to handle the rotate/gesture listeners yourself (we actually use Android's built in rotate/gesture listeners to trigger the gesture callback events).

Else, you should also have all the information you need (pinch / rotation values) to determine your own custom threshold, and thus to toggle between rotating or scaling your 3D object.

dthian avatar Sep 14 '18 20:09 dthian

@achuvm Yes, I am able to achieve that. However, I cannot get a smooth rotating and scaling. My issue sometimes conflig actions, for example when I using two fingers to rotation but model do zoom out or zoom in and when I want to scale model then that do rotation model.

Is it still an issue? Because I am experience the same problem.

lezan avatar Jul 01 '19 10:07 lezan