ARCore Front Camera placing models and moving them on screen (without anchors)

414 Views Asked by At

Sup guys, I develop one simple app with ARCore, and trying to set in front camera 3D objects, and move it (resize). I know that anchors don't work in frontcam mode, but them don't need me. I want to move my models only on screen (for doing selfie with any 3D stuff). Moving and change size.

I am trying to do with TransformableNode - but it did not work and crush if I try to change location. Then I make it with static Node (on screen), but it's not enough. Please help, I really stacked!

ModelRenderable.builder()
        .setSource(App.getAppContext(), Uri.parse(arModel.getArModelModifications().get(0).getUrlSfb()))
        .build()
        .thenAccept(modelRenderable -> {
            Node node = new Node();
            node.setParent(getArSceneView().getScene().getCamera());
            node.setRenderable(modelRenderable);
            node.setLocalScale(new Vector3(0.3f, 0.3f, 0.3f));     /*size*/
            node.setLocalPosition(new Vector3(0, -0.69f, -1.0f));  /*1)0-centre for horizontally, 2) 1 - bottom, 3) long-deep*/
        })
        .exceptionally(
            throwable -> {
                Log.d(TAG, " err: " + throwable.toString());
                return null;
             });
0

There are 0 best solutions below