小编And*_*row的帖子

如何在Android ArCore Sceneform API中的对象上设置重复纹理?

我已经成功地在AR场景中的两个向量之间划了一条线。

我的代码:

private void addLineBetweenPoints(Scene scene, Vector3 from, Vector3 to) {
        // prepare an anchor position
        Quaternion camQ = scene.getCamera().getWorldRotation();
        float[] f1 = new float[]{to.x, to.y, to.z};
        float[] f2 = new float[]{camQ.x, camQ.y, camQ.z, camQ.w};
        Pose anchorPose = new Pose(f1, f2);

        // make an ARCore Anchor
        Anchor anchor = mCallback.getSession().createAnchor(anchorPose);
        // Node that is automatically positioned in world space based on the ARCore Anchor.
        AnchorNode anchorNode = new AnchorNode(anchor);
        anchorNode.setParent(scene);

        // Compute a line's length
        float lineLength = Vector3.subtract(from, to).length(); …
Run Code Online (Sandbox Code Playgroud)

android arcore sceneform

2
推荐指数
1
解决办法
918
查看次数

标签 统计

android ×1

arcore ×1

sceneform ×1