您可以将WebGL 3D对象转换为3D格式(FBX,GLTF等)吗?
几年前,我们有一些传统的WebGL 3D对象,我们想更新。开发人员当时设置了代码,以便将其读取在二进制数据(a .bin文件)中。从该二进制文件,几何数据将通过JavaScript代码解析;我认为部分使用dataview.js。我们不再拥有这些专业知识,因此真的很想将这些旧的WebGL对象移至GLTF或FBX之类的东西,以便我们的3D/Graphics Guys可以更轻松地修改。
我们无法“打开”二进制。因此,我正在研究哪些选项必须将.bin的使用权转换为我们可以使用的东西。
We have some legacy WebGL 3D objects that were developed a few years ago that we would like to update. The developer at the time set up the code so that it would read in binary data (a .bin file). From that binary, the geometric data would be parsed by JavaScript code; I think in part using Dataview.js. We no longer have that expertise, so would really like to move these legacy WebGL objects to something like gltf or fbx so that our 3D/graphics guys can more easily modify.
We haven't been able to "open" the binary. So I am looking at what options we have to convert the .bin's to something that we can use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,没有WebGL对象这样的东西。而且,不知道该项目是否使用其他库(例如Thrimjs或Raw WebGL),很难推断对象的处理方式。
如果使用三j,则很可能会转换为三j几何格式,在这种情况下,它可以导出到GLTF。但是,可能仍需要大量的调查才能找到从哪里触发此出口的位置。
There is no such thing as a WebGL object unfortunately. And without knowing if the project using another library like threejs, or raw WebGL, it is difficult to infer how the object was processed.
If threejs was used, it most likely was converted to Threejs geometry format, in which case it could be exported to a gltf. But it may still require a fair amount of investigation to find where to trigger this export from.
您可以使用调试器和覆盖功能,例如
绘图
,drawarrays
,纹理绑定等,以捕获WebGL程序消耗的所有数据。现在,这取决于着色器对给定数据的作用。如果简单简单的简单着色器,您提取的数据可能会简单地转换为型号。
诸如销售3D模型的SketchFab之类的网站通过增加着色器的复杂性来使数据混淆。某些代码不需要在那里进行应用程序逻辑,它只能防止数据提取。如果将着色器转换应用于从缓冲区提取的数据上,则仍然可以将模型变成杂物。这很难。
You can use debugger and override functions such as
drawElements
,drawArrays
, texture bindings and more to catch all data consumed by webgl program.Now it depends what does shaders do with given data. In case of very straightforward simple shaders, data that you extracted can be probably simply converted to models.
Some websites like sketchfab that are selling 3d models are obfuscating data by increasing complexity of shaders. Certain code doesn't need to be there for application logic, it is there only to prevent data extraction. Then models can be still ghatered if shader transformations are applied on data extracted from buffers. It is just harder.