帆布与WebGL的对CSS 3D - >选哪个? [英] canvas vs. webGL vs. CSS 3d -> which to choose?

查看:152
本文介绍了帆布与WebGL的对CSS 3D - >选哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关基本的3D Web应用程序,即几个立方体,旋转和平移在三维空间 - 这是更好的选择。

For basic 3d web application i.e. a few cubes, rotation and translation in 3d space - which is better to choose?

的CSS三维似乎最容易,但不支持IE9或在路线图IE10,并提供控制比其他选项较少。 帆布和放大器; WebGL的方式似乎更加复杂,但我不知道他们是面向未来的。

CSS 3d seems the easiest, but is not supported on IE9 or on the roadmap for IE10, and offers less control than the other options. Canvas & WebGL seems way more complicated, but I don't know if they are future proof.

为什么有这么多不同的技术为3D?哪个更好?这是面向未来的?

Why are there so many different techniques for 3D? which is better? which is future proof?

推荐答案

之所以有这么多不同的选择3D是因为整个事情仍然处于不稳定状态 - 3D浏览器是不是一个成品标准,和你列出的选项中,只有一个,在目前所有浏览器的工作原理是画布。

The reason there are so many different options for 3D is because the whole thing is still in a state of flux -- 3D in the browser isn't a finished standard, and of the options you listed, the only one that works in all currently available browsers is Canvas.

IE浏览器,特别是不可能给你太多的喜悦 - 正如你所说,3D甚至没有提名为IE10在这一点上。话虽如此,SVG加入IE9相当晚了一天,所以总有希望。但它不太可能的原因是,微软已经做了点都被正式批准为唯一标准的支持功能。

IE in particular is unlikely to give you much joy -- as you say, 3D isn't even slated for IE10 at this point. Having said that, SVG was added to IE9 quite late in the day, so there's always hope. But the reason it's unlikely is that Microsoft have made a point of only supporting features which have been formally ratified as standards.

您列出的技术中,Canvas是的目前的支持最好,但Canvas是不是3D技术;这是一个二维的画布,如果你想拥有它的3D效果,你需要自己写,他们不会被硬件加速。

Of the technologies you listed, Canvas is by far the best supported, but Canvas isn't a 3D technology; it's a 2D canvas, and if you want to have 3D effects in it, you need to write them yourself, and they won't be hardware accelerated.

我想真正找到问题的答案取决于如何重要的功能是为您的网站。如果它只是吸引眼球,其中不支持的浏览器的用户可以脱离,然后通过各种手段与一些3D CSS做到这一点。但是,如果你需要使它在所有的主流浏览器一致,然后用帆布做的。

I guess the real answer to your question depends on how important the feature is for your site. If it's just eye candy, which users of unsupported browsers could live without, then by all means do it with some 3D CSS. But if you need to make it consistent in all current browsers, then do it with Canvas.

我倾向于不使用WebGL的为你的情况建议,因为它听起来这将是矫枉过正,你在做什么。

I'd tend to recommend not using WebGL for your case, because it sounds like it would be overkill for what you're doing.

3D CSS可能是右键的答案,而是用帆布现在,直到浏览器的其余部分添加支持3D CSS。

3D CSS is probably the right answer, but use Canvas for now, until the rest of the browsers add support for 3D CSS.

这篇关于帆布与WebGL的对CSS 3D - >选哪个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆