在 Autodesk forge 查看器中升级三个 js 版本 [英] upgrade three js version in autodesk forge viewer

查看:21
本文介绍了在 Autodesk forge 查看器中升级三个 js 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想升级在幕后 autodesk forge 中使用的三个 js,升级的原因是我正在尝试使用 this 库,这需要三个 js r71 及更高版本,并且在伪造查看器中似乎他们正在使用 r33.我找到了一个博客,它向我展示了如何利用后三个 js 的优势.我跟着它,但似乎它不起作用.伪造查看器现在有 2 个对三个 js 的引用,它会混淆使用哪个,因此一些代码表现得很奇怪

I was looking to upgrade the three js which is used in autodesk forge behind the scene and reason for upgrade is I am trying to use this library and this need three js r71 and above and inside forge viewer it seems they are using r33. I found a blog where it showed me how can I take the advantage of later three js. I followed it but seems like its not working. There forge viewer now have 2 references of three js and it gets confused which one to use and hence some of code behave weird

这是发生在我身上的例子之一

here is one of the example happening to me

THREE.Object3D.add: object not an instance of THREE.Object3D. 

当我尝试添加场景时出现此问题

I am getting this when I am trying to add a scene

有些人可能想知道 forge 查看器附带的三个 js 发生了什么所以这里是被破坏的东西

some might would like to know what was happening with the three js which comes with forge viewer so here is the thing which is getting broken

我也试过在下面做这件事给三个js添加源码

I have also tried doing this below things adding source to three js

 <script src=" https://cdnjs.cloudflare.com/ajax/libs/three.js/r122/three.min.js"></script>

那么有没有其他我可以尝试并使其工作的解决方案如果有人尝试过网格线库并遇到类似的问题并且有解决方案请告诉我

So is there any other solution which I can try and make it work also If someone had tried meshline library and faced similar issue and have solution for it do let me know

推荐答案

Forge Viewer 使用 Three.js 71 版,由于两个库的编写方式,很遗憾很难将 Forge Viewer 移植到更现代的版本三.js.

Forge Viewer uses Three.js version 71, and due to the way both libraries are written, it is unfortunately very difficult to port Forge Viewer to more modern versions of Three.js.

您可以尝试手动向后移植您感兴趣的 Three.js 部分(我为 Potree 点云库),但此类工作不受官方支持.

You can try back-porting parts of Three.js that you're interested in manually (I did that for the Potree point cloud library), but such work is not an officially supported.

这篇关于在 Autodesk forge 查看器中升级三个 js 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆