javascript 在 Web 浏览器中显示 3dsmax 模型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7268485/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Display 3dsmax models in web browser
提问by Rami Dabain
I have some 3d models written in 3dmax/maya/cad/4dcinema , i wand to display them in my website so user can rotate the model and inspect it .
我有一些用 3dmax/maya/cad/4dcinema 编写的 3d 模型,我想在我的网站上显示它们,以便用户可以旋转模型并检查它。
i have found this on the internet http://replimat.com/thingiview/examples/client_side_ajax.htmli think it will work IF i could somehow convert those models from 3dmax/maya/cad/3dcinema to OBJ/STL .
我在互联网上找到了这个http://replimat.com/thingiview/examples/client_side_ajax.html我认为它会起作用,如果我能以某种方式将这些模型从 3dmax/maya/cad/3dcinema 转换为 OBJ/STL 。
is there any converter available for linux ? or any other method to display those models in web browser without having to install anything on the browser ? thank you .
有没有适用于 linux 的转换器?或任何其他方法无需在浏览器上安装任何东西即可在网络浏览器中显示这些模型?谢谢 。
采纳答案by vishakvkt
Export your model in maya to a wavefront(.obj) file. Then you could use a library like three.js, along with this script to load and view .obj files within the browser
将 Maya 中的模型导出为波前 (.obj) 文件。然后你可以使用像three.js这样的库,连同这个脚本在浏览器中加载和查看.obj文件
Programming the moveable camera can also be done using the library. If you want to use the default formats, it will be tricky as you may need to write the parser yourself if there isn't one and the spec is freely available.
也可以使用库对可移动相机进行编程。如果您想使用默认格式,这将很棘手,因为如果没有解析器并且规范是免费提供的,您可能需要自己编写解析器。
回答by Ashwin
Check this link. - http://www.thoro.de/page/3dnp-introduction-en
检查此链接。- http://www.thoro.de/page/3dnp-introduction-en
Visitors don't need to install anything on their browser, just click and go. Your 3d model loading takes some time, for that a progress bar is shown.
访问者不需要在他们的浏览器上安装任何东西,只需点击即可。您的 3d 模型加载需要一些时间,因为会显示进度条。
回答by SpliFF
For the widest range of existing solutions you won't beat converting your models to VRML.
对于最广泛的现有解决方案,您将无法将模型转换为VRML。
This format has plugins that support browsers as far back as IE 3 and Netscape 4. There are a large number of free and commercial pluginsthat handle this format. If you don't want the user to rely on plugins there are also java applet based viewers.
这种格式的插件可以支持 IE 3 和 Netscape 4 等浏览器。有大量的免费和商业插件可以处理这种格式。如果您不希望用户依赖插件,还有基于 Java 小程序的查看器。
There should be a variety of tools that will convert your models to VRML as well, even if you have to save to an intermediate format first.
应该有多种工具可以将您的模型转换为 VRML,即使您必须先保存为中间格式。
The main downside of VRML is lack of fancy new features like shaders, bones and complex texturing but whether those things are necessary all depends what you're trying to achieve.
VRML 的主要缺点是缺乏花哨的新功能,如着色器、骨骼和复杂的纹理,但这些东西是否必要完全取决于您要实现的目标。
回答by trigrou
You can try to use this webservice http://showwebgl.comit does not support 3dsmax directly but you could export your model into obj or collada then upload it. Have a look at the faq if it fits your need. http://showwebgl.com/faq
您可以尝试使用此网络服务http://showwebgl.com它不直接支持 3dsmax 但您可以将您的模型导出到 obj 或 collada 然后上传它。如果它符合您的需要,请查看常见问题解答。http://showwebgl.com/faq
回答by Lior Ohana
I remember 3dsmax support obj format, regarding the other apps I don't remember. Anyway, you can use try this tool, you didn't mention which formats you saved from 3dsmax/maya/cad/3dcinema but it supports many format.
我记得 3dsmax 支持 obj 格式,关于我不记得的其他应用程序。不管怎样,你可以使用试试这个工具,你没有提到你从 3dsmax/maya/cad/3dcinema 保存的格式,但它支持很多格式。
回答by RobotEyes
I've done this using X3DOM. It allows you to script interaction with the 3D object using javascript.
我已经使用 X3DOM 完成了这项工作。它允许您使用 javascript 编写与 3D 对象的交互脚本。
- First export from 3ds Max as VRML.
- Convert the VRML to X3DOM by copying and pasting the code into this online converter.
- Simply insert the converted code into your web page where desired.
- 首先从 3ds Max 导出为 VRML。
- 通过将代码复制并粘贴到此在线转换器中,将 VRML 转换为 X3DOM 。
- 只需将转换后的代码插入您的网页所需的位置。
Because the 3D model is now part of the dom you can manipulate it with javascript and style it with CSS. Here's an example.
因为 3D 模型现在是 dom 的一部分,所以您可以使用 javascript 操作它并使用 CSS 设置样式。这是一个例子。