简体   繁体   English

autodesk forge potree 问题 - BufferGeometry.addAttribute() 已弃用。 使用 BufferGeometry.setAttribute() 代替

[英]autodesk forge potree problem-BufferGeometry.addAttribute() is deprecated. Use BufferGeometry.setAttribute() instead

I am going to proceed with importing point cloud through potree with the following example file.我将使用以下示例文件继续通过 potree 导入点云。 https://github.com/Autodesk-Forge/forge-extensions https://github.com/Autodesk-Forge/forge-extensions

I was working with the example file, but I got an error "BufferGeometry.addAttribute() is deprecated. Use BufferGeometry.setAttribute() instead".我正在使用示例文件,但出现错误“BufferGeometry.addAttribute() 已弃用。改用 BufferGeometry.setAttribute()”。 This problem also occurs in the example file driven site.这个问题也发生在示例文件驱动的站点中。 It happens on other computers as well.它也发生在其他计算机上。 Here is the error I got:这是我得到的错误:

enter image description here在此处输入图像描述

If this extension works normally, you should see the point cloud converted from the port tree.如果此扩展正常工作,您应该会看到从端口树转换而来的点云。

Thank you for the heads-up.谢谢你的提醒。 The Potree library was ported to the viewer couple years ago, when the viewer was still using WebGL.几年前,Potree 库被移植到查看器,当时查看器仍在使用 WebGL。 Now the viewer is using WebGL2 which is why the port is causing issues.现在查看器正在使用 WebGL2,这就是端口导致问题的原因。 In order to get it working again, I'd suggest that you disable WebGL2 support in the viewer by passing the following options to viewer.start (the first four params can be ignored):为了让它再次工作,我建议您通过将以下选项传递给viewer.start来禁用查看器中的 WebGL2 支持(可以忽略前四个参数):

viewer.start(undefined, undefined, undefined, undefined, {
    webglInitParams: {
        useWebGL2: false
    }
});

After that I was able to load the point cloud again.之后我可以再次加载点云。 Here's a branch of one of our code samples with this modification: https://github.com/autodesk-platform-services/aps-simple-viewer-nodejs/tree/sample/potree .这是经过此修改的代码示例之一的分支: https://github.com/autodesk-platform-services/aps-simple-viewer-nodejs/tree/sample/potree

Also, note that the addAttribute vs setAttribute are just deprecation warnings, not errors.另外,请注意addAttributesetAttribute只是弃用警告,而不是错误。 In the code branch above I've updated the potree.js script as well so that the warnings do not appear anymore.在上面的代码分支中,我也更新了potree.js脚本,这样警告就不会再出现了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM