ARCore模型大小

huangapple go评论82阅读模式
英文:

ARCore model size

问题

我正在尝试将一个3D模型放入ARCore框架中但是当我要放置这个模型时它会变得过大并且不会出现在屏幕中央我不想通过点击来放置它应用会自动地放置这个模型

Anchor newMarkAnchor = session.createAnchor(frame.getCamera().getPose().compose(Pose.makeTranslation(0, 0, -0.5f)).extractTranslation());
AnchorNode addedAnchorNode = new AnchorNode(newMarkAnchor);
ModelRenderable.builder().setSource(getApplicationContext(), R.raw.imac).build().thenAccept(modelRenderable -> renderable = modelRenderable).exceptionally(throwable -> {Log.i("asdasdasd", "error: "+throwable.getLocalizedMessage());
    return null;
});
addedAnchorNode.setRenderable(renderable);
addedAnchorNode.setParent(arSceneView.getScene());
英文:

I'm tring to put a 3D Model into an ARCore Frame, but when I'm going to place the model it comes oversized and does not appear at the center of the screen. I don't want to place it with a tap, the app places the model automatically .

Anchor newMarkAnchor = session.createAnchor(frame.getCamera().getPose().compose(Pose.makeTranslation(0, 0, -0.5f)).extractTranslation());
                AnchorNode addedAnchorNode = new AnchorNode(newMarkAnchor);
                ModelRenderable.builder().setSource(getApplicationContext(), R.raw.imac).build().thenAccept(modelRenderable -> renderable = modelRenderable).exceptionally(throwable -> {Log.i("asdasdasd", "errore: "+throwable.getLocalizedMessage());
                    return null;
                });
                addedAnchorNode.setRenderable(renderable);
                addedAnchorNode.setParent(arSceneView.getScene());

答案1

得分: 1

检查您的模型在3D软件中的尺寸,在ARCore中,虚拟世界中的1个单位相当于现实世界中的1米。

看起来您正在使用Sceneform,是吗?您可以通过setWorldScale(Vector3)setLocalScale(Vector3)轻松地缩放您的节点。

英文:

Check the dimensions of your model with 3D software, in ARCore 1 unit in the virtual world is equivalent to 1 meter in the real world.

Looks like you're using Sceneform, is this correct? You can scale your Node easily through setWorldScale(Vector3) or setLocalScale(Vector3).

huangapple
  • 本文由 发表于 2020年9月22日 18:04:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/64007438.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定