virocore
virocore copied to clipboard
3D model rotation and zoom does not smooth?
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.
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.
Hi @radvani ,
I use Pixel XL - OS 8.1 for testing.
Thanks.
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 What if I want to have smooth 3D scaling and rotating in my AR application? Is it possible to achieve that?
@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 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?
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 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.
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,
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.
@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.