【问题标题】:how to load multiple 2D texture on a single 3D Object in AR Core?如何在 AR Core 中的单个 3D 对象上加载多个 2D 纹理?
【发布时间】:2018-03-29 16:02:00
【问题描述】:

如何在 AR Core 中为单个 3D 对象加载多个 2D 纹理

【问题讨论】:

    标签: android augmented-reality arcore android-augmented-reality


    【解决方案1】:

    这与arcore无关。您的问题的答案基于您使用的 3d 引擎。 Arcore 不是 3d 引擎

    【讨论】:

    • if (preferenceHelper.getStringValue("png") == Writing_Table_black) { WritingTable.createOnGlThread(/*context=*/this, Writing_Table_obj, Writing_Table_black); WritingTable.setMaterialProperties(0.0f, 3.5f, 1.0f, 6.0f); drawObj(WritingTable, viewmtx, projmtx, lightIntensity); }
    • 实际上,当单击列表中的特定颜色时,我已经更新了绘制值。它的工作,但一段时间后会话将暂停阶段..所以得到会话过期问题..如何解决这个问题? @Fixus
    • @ManiKandan 老实说,我不知道你在说什么 :) 你的代码与 ARCore 本身无关。你在错误的地方问这个问题。您的问题与您正在使用的 3D 引擎有关(据我所知是 OpenGL),而不是 ARCore 本身。这是两种不同的工具
    【解决方案2】:

    private void drawObj(ObjectRenderer mVirtualObject2, float[] viewmtx, float[] projmtx, float lightIntensity) {

        for (Anchor anchor : anchors) {
            if (anchor.getTrackingState() != TrackingState.TRACKING) {
                continue;
            }
            // Get the current pose of an Anchor in world space. The Anchor pose is updated
            // during calls to session.update() as ARCore refines its estimate of the world.
            anchor.getPose().toMatrix(mAnchorMatrix, 0);
    
            // Update and draw the model and its shadow.
            mVirtualObject2.updateModelMatrix(mAnchorMatrix, 1);
            mVirtualObject2.draw(viewmtx, projmtx, lightIntensity);
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-08-29
      • 1970-01-01
      • 2021-03-03
      • 2023-03-13
      • 2012-12-19
      • 2020-01-12
      • 1970-01-01
      • 1970-01-01
      • 2020-02-21
      相关资源
      最近更新 更多