我有一个要在场景PotreeConverter中加载的点云数据。potree-coreTHREEjs
当我按原样运行场景时,从flask后端一切正常,我有一个点云和一个围绕它的 bbox。但是当场景被包裹在一个React组件周围时,会渲染 bbox 但不会渲染点
有什么理由应该这样吗?据我了解,react 是在与原始 DOM 分离的 shadowDOM 上呈现的,也许与它有关?
我将我的 potree-core 初始化如下,也许会给你一个线索:
import {
loadPointCloud,
PointColorType,
PointSizeType,
PointShape,
Global,
Group
} from 'potree-core/build/potree.module'
const PotreeCore = {
loadPointCloud,
PointColorType,
PointSizeType,
PointShape,
Global,
Group
}
// ... later in code (simplified version of what I have ...)
PotreeCore.Global.workerPath = '/resources/libs/potree'
//matches a static resources location on my server
//which contains BinaryDecoderWorker.js, along other decoders
PotreeCore.loadPointCloud(url, name, ({pointcloud}) => {
scene.add(pointcloud) // add to three.js scene
})