简体   繁体   中英

upgrade three js version in autodesk forge viewer

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

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

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 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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