<p>Triangles are always flat, unlike a quad which can be made in a way that is bent / not all vertices on the same plane. </p>

<p>If you were to interpolate say vertex normals across each scanline, on a 4-edge bent quad it will render with horizontal (scanline) artefacts. If you made that same bent quad out of triangles, it will render correctly as each triangle has a different normal slope. </p>

<p>That's one reason why triangles are preferable for scanline rasterising</p>

CC BY-SA 4.0
2019-07-10T09:21:15.757Z
Non-planar quads would also be painful in that they can have 2 interection points per pixel, i.e. have an implicit silhouette edge.
Simon F
CC BY-SA 4.0
2019-07-04T03:13:30.133Z
2019-07-04T03:13:30.133Z
PaulHK
<p>In computer graphics, people are interested in modelling the <em>surface</em> of the objects. And, since we are in the discrete world of computers, we need a discrete representation for surfaces, where we can easily check for stuff like intersections and angles, both vital for rendering.</p>

<p>The triangle makes it very easy to compute intersections and surface normals, but also has some useful features: it is always convex (if not degenerate), which means that the mathematics is a lot simplified. Being so basic, you can also split pretty much any shape in triangles.</p>

<p>But keep in mind that there are other basic shapes. Some hardware supports quads or nurbs, although it's much less common.</p>

CC BY-SA 4.0
2019-07-03T08:40:46.290Z
Quads especially but (arbitrary) Polygons in general could be used in older versions (of OpenGL anyway). I am not exactly sure, but I think there also a hardware optimizations for the triangle related maths you do in rendering.
Tare
CC BY-SA 4.0
2019-07-03T08:37:34.023Z
2019-07-03T08:37:34.023Z
Paul92
<p>I was recently learning about OpenGL and computer graphics development. I have a question regarding the usage of triangle as the basic building block, or basic shape to develop complex shapes. Is there a particular reason? Or just something that "stuck"?</p>

CC BY-SA 4.0
2019-07-07T04:28:37.367Z
Triangles are the basic building block in geometry (mathematics) as well because they are a simplex - the smallest number of points needed to make a shape in the given dimension.
Alan Wolfe
CC BY-SA 4.0
2019-07-22T13:06:26.703Z
not only tris, pathtracing/raytracing techniques does not require triangles https://codepen.io/strangerintheq/pen/OKVVOW
Stranger in the Q
<opengl>
Triangle - Why is it the basic building block for complex shapes
Osama Asif C Infinitum
# Triangle - Why is it the basic building block for complex shapes

(Asked by: username_0 on 2019-07-03)

I was recently learning about OpenGL and computer graphics development. I have a question regarding the usage of triangle as the basic building block, or basic shape to develop complex shapes. Is there a particular reason? Or just something that "stuck"?

**Tags:** opengl

> **Comments:**
> **username_1**: Triangles are the basic building block in geometry (mathematics) as well because they are a simplex - the smallest number of points needed to make a shape in the given dimension.  
> **username_2**: not only tris, pathtracing/raytracing techniques does not require triangles https://codepen.io/username_2/pen/OKVVOW  

---

## 2 answers

### Answer by username_3 on 2019-07-04. Score: 7

Triangles are always flat, unlike a quad which can be made in a way that is bent / not all vertices on the same plane.

If you were to interpolate say vertex normals across each scanline, on a 4-edge bent quad it will render with horizontal (scanline) artefacts. If you made that same bent quad out of triangles, it will render correctly as each triangle has a different normal slope.

That's one reason why triangles are preferable for scanline rasterising

> **Comments:**
> **username_4**: Non-planar quads would also be painful in that they can have 2 interection points per pixel, i.e. have an implicit silhouette edge.  

---

### Answer by username_5 on 2019-07-03. Score: 5

In computer graphics, people are interested in modelling the *surface* of the objects. And, since we are in the discrete world of computers, we need a discrete representation for surfaces, where we can easily check for stuff like intersections and angles, both vital for rendering.

The triangle makes it very easy to compute intersections and surface normals, but also has some useful features: it is always convex (if not degenerate), which means that the mathematics is a lot simplified. Being so basic, you can also split pretty much any shape in triangles.

But keep in mind that there are other basic shapes. Some hardware supports quads or nurbs, although it's much less common.

> **Comments:**
> **username_6**: Quads especially but (arbitrary) Polygons in general could be used in older versions (of OpenGL anyway). I am not exactly sure, but I think there also a hardware optimizations for the triangle related maths you do in rendering.  

---

