You need to enable JavaScript to run this app.
导航

多画布渲染

最近更新时间2023.11.21 14:51:31

首次发布时间2023.11.21 14:51:31

我们提供了工具类 ARSessionContentDuplicator 来帮助你实现将 AR 内容同时显示在多个画布上的效果。

import {
    ARSessionContentDuplicator
} from "@volcengine/webar";

// 创建一个 ARSessionContentDuplicator
// Create a ARSessionContentDuplicator
const contentDuplicator = new ARSessionContentDuplicator(session);
// 添加目标画布
// Add a target canvas.
contentDuplicator.addTarget(anotherCanvas);

当你不再想要使用 ARSessionContentDuplicator 时,请调用它的 dispose 方法来释放资源。

contentDuplicator.dispose();