Html 在网站上嵌入 3D 模型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7107778/
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
Embed 3D models on website
提问by RobinJ
Is there a way to embed Sketchup models on a website? Preferably a free one, if it's a commercial solution I'd like a confirmation that it's actually worth the money... I know about the 3D warehouse thingy where you can rotate it (javascript and some images), but I can't upload anything to the 3D warehouse 'cause it always "resets the connection".
有没有办法在网站上嵌入 Sketchup 模型?最好是免费的,如果它是商业解决方案,我想确认它确实物有所值......我知道可以旋转它的 3D 仓库(javascript 和一些图像),但我无法上传3D 仓库的任何东西,因为它总是“重置连接”。
采纳答案by Stephan B
You can try the upcoming WebGL Functions in modern Browsers. There are some Javascript Libraries that can read model files and show them within your (HTML 5?) website. I have not used them yet, but try these links if this sounds interesting:
您可以在现代浏览器中尝试即将推出的 WebGL 函数。有一些 Javascript 库可以读取模型文件并在您的(HTML 5?)网站中显示它们。我还没有使用它们,但如果这听起来很有趣,请尝试这些链接:
https://github.com/mrdoob/three.js/
https://github.com/mrdoob/three.js/
回答by Christian Landgren
I made a patch of an example game in three.js. Added ColladaLoader and Sketchup model + Third Person Shooter controls: https://github.com/irony/NemesisTry it out (Works best in Chrome)
我在three.js中制作了一个示例游戏的补丁。添加了 ColladaLoader 和 Sketchup 模型 + 第三人称射击控件:https: //github.com/irony/Nemesis试试看(在 Chrome 中效果最佳)
回答by Décébal Hormuz
You can use http://sketchfab.com, they even have a SketchUp exporter.
你可以使用http://sketchfab.com,他们甚至有一个 SketchUp 导出器。
回答by Jonathan M
Yes, you can do it without cost. See here: https://help.sketchup.com/en/article/3000258
是的,你可以不花钱。请参阅此处:https: //help.sketchup.com/en/article/3000258
EDIT:
编辑:
There were some free rendering sites apart from Google, but they don't seem to be in operation anymore. Posting to the Google 3D warehouse is going to be your best bet. Regarding your problem posting there, try it with Chrome.
除了谷歌之外,还有一些免费的渲染站点,但它们似乎不再运行了。发布到 Google 3D 仓库将是您最好的选择。关于您在那里发布的问题,请尝试使用 Chrome。
EDIT #2: If you don't want to upload to Google 3D Warehouse, you can achieve a similar effect with a little work. 3D Warehouse doesn't actually give the visitor the power to manipulate something in 3D, but rather it lets them "rotate" the image horizontally by simply showing a series of preset images of the 3D from various angles. You can take shots of your 3D object, import to Photoshop and create your own gif of the spinning object. A little more work than relying on Google, so you'll have to decide if it's worth it.
编辑 #2:如果您不想上传到 Google 3D Warehouse,您可以通过一些工作实现类似的效果。3D Warehouse 实际上并没有赋予访问者操作 3D 内容的能力,而是让他们通过简单地从不同角度显示一系列 3D 预设图像来水平“旋转”图像。您可以拍摄 3D 对象的照片,导入到 Photoshop 并创建您自己的旋转对象 gif。比依赖谷歌要多一些工作,所以你必须决定它是否值得。
EDIT #3: If all else fails you can simply post the 3D model on your site as a downloadable file and advise visitors to get Sketchup to view it.
编辑 #3:如果所有其他方法都失败了,您可以简单地将 3D 模型作为可下载文件发布在您的网站上,并建议访问者使用 Sketchup 进行查看。