有哪些库可以用
我正在寻找一个 3-d 轨道飞行器,因此,我显然需要透视图、相机移动等。我还需要能够将纹理应用到几何体。考虑到复杂性,除了 或 flash 之外,我没有看到这种情况发生。
据我了解, 仅限于 2d,但您可以使用 JS 完成所有 3d 工作,并将 2d 投影简单地输出到画布中。我的理解就到此为止了,弄清楚这一切似乎相当复杂。
问题#1:有哪些 3D 图形库可以提供我需要的基本功能(3D->2D 透视投影、纹理、相机动画以及平移、缩放的流畅用户输入) 、倾斜、移动摄影机等)?
问题#2:在我自己找到的提供此类功能的非专有库(Three.js 和 C3DL)中,它们似乎都需要 webGL。此类事情是否非常需要 webGL,或者对 的支持是否足够?如果不需要 webGL,如果我不做任何会拖累 CPU 的事情,是否有任何理由使用它?
注意:除非有人另有建议,否则我将继续尝试学习 Three.js 来完成此任务。
I'm looking to do a 3-d orbiter, thus, I obviously need perspective views, camera movement, etc. I also need to be able to apply textures to the geometry. Given the complexity, I don't see this happening in anything other than <canvas>
or flash.
As I understand it, <canvas>
is limited to 2d, but you can do all of the 3d work with JS and simply output the 2d projection into the canvas. My understanding stops right about there, and figuring all of this out seems rather complicated.
Question #1: What 3d graphics libraries are out there that offer the basic features that I need (3d->2d perspective projections, textures, animation of the camera, and fluid user input that pans, zooms, tilts, dollies, etc. the camera)?
Question #2: Out of the non-proprietary libraries that offer this type of functionality that I've been able to find on my own (three.js and C3DL,) they all appear to require webGL. Is webGL pretty much required for this type of thing, or is support for <canvas>
sufficient? If webGL isn't required, is there any reason to use it if I'm not making anything that would bog down the CPU?
Note: I'm going to go ahead and try to learn three.js to get this done unless someone advises otherwise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,Canvas 绝不“局限于”2D。有一个 2D 上下文,如果您确实需要,可以用它制作 3D 场景(见下文)。正如您所说,另外还有使用不同规范的 3D 渲染 WebGL 上下文。
对于答案#2,WebGL 绝不是必需的。例如,该库仅使用 2D 画布上下文进行 3D 投影:
http://arc.id.au/Canvas3DGraphics。 html
还有几个投影纹理/旋转对象的示例,例如:
http://acko.net/files/projective/index.html
要回答#1,上面有链接的库,但它确实是我见过的唯一一个使用2D 上下文。
First off, Canvas is in no way "limited" to 2D. There is a 2D context and if you really want you can make 3D scenes with it (see below). As you say, there is additionally the WebGL context for 3D rendering that uses a different spec.
To answer #2, WebGL is in no way a requirement. For instance this library projects 3D using only the 2D canvas context:
http://arc.id.au/Canvas3DGraphics.html
There are also several examples of projective texturing/rotating objects, such as:
http://acko.net/files/projective/index.html
To answer #1, there is the library linked above, but its really the only one I've seen that uses the 2D context.