将 ThreeJS 几何导出到 JSON [英] Export ThreeJS Geometry to JSON
本文介绍了将 ThreeJS 几何导出到 JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将三几何导出到 JSON,以便我可以与 xml3D 一起使用.
I need to export Three Geometry to JSON so I can used with xml3D.
我试图找到 THREE.GeometryExporter() 但我找不到.它是否已被完全弃用?这里提到了
I am trying to find the THREE.GeometryExporter() but I can't. Has it been completely deprecated? It is mentioned here
一旦我有了三个 JSON,我应该能够使用这个转换器来获取 xml3D JSON.
Once I have the Three JSON I should be able to use this converter to obtain the xml3D JSON.
有人试过吗?
推荐答案
你应该试试 toJSON()
方法:
var json = geometry.toJSON();
此方法可用于几何、材料、灯光、网格...
This method is available for geometries, materials, lights, mesh ...
这篇关于将 ThreeJS 几何导出到 JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文