[ELI5] Why can computers not make curves?

904 views

Every 3D modelling software simply uses a series of flat polygons, small enough to appear curved, to created spheres etc. Why? Why can technology even today find it easier to render literally millions of little triangles, than just one curve?

In: Technology

16 Answers

Anonymous 0 Comments

Fun thing.

How long is a coast line? Measure it with a meter stick you get one measurement. Measure it with a centimeter stick and convert to meters you get a different larger measurement. Measure with a kilometer stick and convert to meters you get a smaller measurement. Measure with a millimeter stick, or a micrometer stick you get larger and larger measurements. As you decrease the length of your measuring stick you increase the resolution of your measurements. Your micrometer stick can get into all the little tiny crevasses and overall the bumps. Your kilometer stick skips huge gaps and even the whole shore line of a bay.

So what? It’s just cool.

But… the real world has “pixels” just like a monitor. They are spherical-like and are 3 dimensional. Usually they are called atoms.

If you measure with a planck-length stick you can measure the circumference of the atoms and add those to your coastline measurement too.

Now your monitor has sub-pixels that are square and much much larger than atoms. You don’t have to work as hard to make a circle look smooth on a monitor because you will never make one smoother than the sub-pixels. So approximating the curve with straight lines does a pretty good enough job.

Anonymous 0 Comments

Triangles are also a very good way to store data. If you boil it down to just geometry, then to draw a triangle you need to store 3 points in 3D space (the most memory) then the order that the edges connect. To draw the NEXT triangle you only need to store one other 3D point, since 2 points already exist. What you end up doing then is usually storing a point list, and some data to describe how to turn those into a surface.

It gets more complicated after that, not all triangles are connected, you are storing directional normal for each point, texcoords and so on…

Anonymous 0 Comments

3D graphics hardware relies on a simple idea – break up the task of producing a picture into lots and lots and lots of very simple tasks, and farm out those tasks to lots and lots of very simple computer processors.

This means that they break up the image into lots and lots of tiny triangles, and farm the rendering of each of those triangles out to the many processors in the graphics chips.

With an actual curve, you have one very large complex object. Rendering that is going to be one very complex task, which graphics hardware isn’t set up for. Dividing the task up, on the fly, into many little tasks is also going to be complex and time consuming. Doing that in the 1/60th of a second you have between frames is just too much. So instead, when the program or game is created, we break up that curve into as many tiny triangles as our hardware can manage, and hide the roughness with a blur filter.

Anonymous 0 Comments

As other people have mentioned you can use curves in 3D modelling software.

If you want to put your 3D model into a game though, most games don’t render curves, so the modelling software will convert your curves into a series of polygons.

Most games don’t render curves because triangles are much easier and still good enough.

Anonymous 0 Comments

It’s not impossible. It’s relatively easy to directly render spheres, cylinders, cones, conic sections and other shapes that can be described in nice mathematical terms. The problem is if you want more general shapes you need building blocks that are general enough to describe almost any shape and nice enough to lend themselves to efficient implementation in hardware/software. Triangles are one or even the simplest shape that fulfills both of these criteria.

Anonymous 0 Comments

Because for the software to render the polygones, it needs to compute a lot of calculations to determinate their position and orientation(how they would appear), mostly matrix multiplications. Those work best with line because their mathematical representation is easier to store and compute. Curves usually need 4 control points to be defined (the types of curves would fall out of eli5) while lines only need 2.

Other properties such as the normal vector (used for illumination and reflexion) and interpolation (shaders) are also more straight forward using simple polygones. Try to calculate the average value of a polygon, you just average the values of its corners. Now try to do it with a curved shape…

So yeah, simple shapes like triangle are better for this sort of stuff. Plus, we can add texture and shading to **simulate** the curveness afterwards.

Anonymous 0 Comments

Truth is every major 3d package has a method to model with curves, splines, etc. When you render you’re just describing the curve as a number of steps/angles into pixels. Calculating lighting, reflections, refractions you speed up calculations breaking up the model into flat planes of triangles, same for deformations, physics, etc. it’s all about simplifying and speed. A circle built out of 40 (8degree) triangles looks like a circle and you don’t even need half that many if it’s in the background and/or motion.

Anonymous 0 Comments

They can. NURBS. Non Uniform Rational B-Splines. Also vector graphics use it too. The graphics drivers translate that into a raster for your screen or printer, but the curves themselves are mathematical equations.

Not all 3D software is limited to polygons (specifically triangles and quads) Cinema 4D, for one, has full NURBS modeling tools.

Edit: IMO this is the biggest missing thing from Blender. Being able to model with sweep NURBS, lathe, extrude and more all defined by vectors. It’s amazing.

Anonymous 0 Comments

They can make curves. However rarely do you as a user see them. In that I mean it is easier and more efficient to draw a curve as segments that connect. There is less math involved this way and remember a computer is ultimately an advanced calculator.

So let’s say you want to draw a circle using points. Well how many points do you want. Technically there are infinite number of points that can be used and always still be an open object as there is a gap between them. However using lines, let’s say it takes 360 (or 1 per degree) to “appear” on screen as a smooth shape, the computer can quickly calculate this and it is now a closed shape.

Where this gets tricky is when using a computer to make something in real life. Say on a CNC machine on various types. Even though you drew a circle that was represented with lines, the computer still knows its a circle. There are g-codes that allow machines to create circles, thus in the real world, you are back to having a circle.

Now there are cases and softwares that are designed for this and they to can make true arcs and circles. However they also have the logic in them to delineate what the shape is and how to treat it (open or closed).

Anonymous 0 Comments

Your premise is incorrect. Not all 3D modeling software is limited to triangles. 3D Studio Max, for example, can model shapes with true curved surfaces.

As for why most 3D engines use triangles instead of curves though, it’s simply because they’re faster and easier to deal with. A spline curve is exponentially more mathematically complex than a flat triangle. “Technology even today” isn’t going to change that mathematical fact.

And individual curved surfaces are rarely approximated with “millions” of triangles. With Gouraud or [Phong](https://en.wikipedia.org/wiki/Phong_shading) shading an object can be made to look realistically curvy with only a few hundred or even dozen polygons.