为什么3D引擎主要使用三角形绘制表面? [英] Why do 3D engines primarily use triangles to draw surfaces?

查看:301
本文介绍了为什么3D引擎主要使用三角形绘制表面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么三角形总是用于3D绘图表面?为什么不是正方形或其他形状的?

Why are triangles always used for drawing surfaces in 3D? Why not a square or some other shape?

推荐答案

三角形绝不可能是非平面的;超过3个点什么都可以是非平面的,因此未渲染,除非转化为三角形。

Triangles can never be non-planar; anything with more than 3 points can be non-planar and thus un-renderable unless converted to triangles.

例如:正方形是两个三角形是在同一平面上,如果所有组成正方形的点是共面。这需要大量的计算,以确保所有的点是共面的,因此是大于3点是$ P $对 - 计算通过抽选成三角形和测试,以确保所有的点在同一平面的所有多边形一次,而不是在每一个被渲染帧。

For example: A square is two triangles that are on the same plane, if all the points that make up the square are co-planar. It takes a lot of calculations to make sure all the points are co-planar, thus all polygons that are greater than 3 points are pre-calculated by decimating them into triangles and tested to make sure all the points are co-planar once, instead of on every frame that gets rendered.

下面是关于多边形很好的参考网格

Here is good reference about polygon meshes.

平面网

非平面网

和一个例子可能更清楚。

and one more example that might make it clearer

非平面网格是简并的,不能进行排序或呈现的正确的任何理智方式。三角形没有这个问题。

The non-planar mesh is degenerate and can't be sorted or rendered correctly in any sane manner. Triangles don't have this problem.

效率

三角形也非常的内存使用效率,并可以进行排序,并使用三角形条只需要1时渲染速度极快点要存放后的第一每增加三角

Triangles also are very memory efficient and can be sorted, and rendered extremely fast when using Triangle Strips which only need 1 point to be stored for each additional triangle after the first.

三角形扇这是一个三角形地带的一个特例。

and Triangle Fans which is a special case of a Triangle Strip.

这篇关于为什么3D引擎主要使用三角形绘制表面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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