Polygon Modeling

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Polygon Modeling is used in 3d computer graphics to create shapes.

[edit] Theory of Polygon and Mesh Modeling

In real life, objects are made of unimaginable numbers of atoms. Computers can’t quite deal with the complexity of real life, so we need to use something simpler.

The simplest thing we can define on a computer is a point in space. (Similarly, if I had a piece of paper in front of me, the easiest thing I could draw on it would be a point, I’d just tap my pencil to the paper.) A point in space is called a Vertex.

PolygonModeling-Fig1-Vertex.png PolygonModeling-Fig2-SurfacOfTriangle.png

Now consider this. Each point (or vertex) on the paper has a number. We will call the first point I drew, Vertex 1. If I went ahead a drew more vertices, the second vertex I drew would be called Vertex 2 and the third would be called Vertex 3, and so fourth.

A bunch of points really don’t do us much good on their own. So we will connect them, like a connect the dots game. If we connect three of them, and fill in the center, We’ll get a triangle, the simplest surface we can create with vertices.

PolygonModeling-Fig3-triangle2.png

If we create additional triangles, (extended from the first), we can create more complicated surfaces. Any surface can be created if we use enough triangles!

If two triangles are beside one another, and seem to form one side of an object, we’ll usually call them a polygon, and deal with them as a polygon as opposed to calling them two triangles. It will still be made of two triangles, but we’ll just call them a poloygon to make it easier.

TRIANGLES ARE THE SIMPLEST SURFACE FOR COMPUTERS TO DEAL WITH.

Triangles have several properties which make them easy for the computer to deal with:

  • They are made of straight angles. Triangles are made of straight sides and have no curves. Computer deal with straight lines well. They do not deal with curved lines easily. Think of it this way, if I gave you a piece of paper with two points on it and said, “draw a straight line between those two points”, you’d know exactly what I meant. Everyone I gave that paper to would draw the same line if they followed directions. Now suppose I gave you that same piece of paper and said, draw a curved, rounded line between the two points. Those are vague directions. You would be unsure of what exactly I wanted you to draw. Each person I gave that assignment to would draw slightly different curved lines. In order to make sure everyone drew identical curves between the two points, I would need to give much more complicated directions.
  • They are flat.
  • They cannot self intersect. If you had two polygons, they could intersect with (go through) each other. Computers have a hard time handling intersections. So triangles are easier to deal with because they can not go through themselves.

Polygons are the next simplest surface.

A polygon is like a triangle but has more sides. A square is a polygon. Any polygon can be easily broken down into triangles, so it is still quite simple. Polygons are usually flat, or close to being flat. If the two triangles form an extreme angle (are not flat) then we usually won’t call them a polygon. The concept of Normals:

Each triangle or polygon in animation software has a ”normal” If a triangle was a tabletop, its normal would point straight up, away from the surface. Normals are always perpendicular to the surface. In order to simplify the amount of work the computer needs to do, 3D software can perform something called “backface culling”. Cull meaning “to not show”, “trim away”, “ignore”, backface meaning, the back of faces, or, the back of polygons. Backface culling means not showing the back of polygons, only showing the front, or more accurately, the side normal points from.

Example: Normals on a regular sphere point away from the center of the sphere. If you were standing outside of a giant sphere and you looked at, you would be able to see it. If you were standing inside of it however, you would not be able to see it. Backface culling would eliminate the inside of the sphere because it normals do not face towards you.

The normal is defined by the order you count the vertices in when defining the polygon. Whether you go around one way or the other when drawing the original triangle or polygon. You should never need to worry about this. Just be aware that you will often need to “flip the normal” a command found somewhere in every respectable modeling package. Element (Continuous Mesh):

A element is a distinct surface. If two polygons are created side by side, each created out of different vertices than the last, they are considered to be individual elements, (or not a continuous mesh). Suppose we have two triangles. (Fig 1) They are two elements. Not suppose we move them together so that they are touching. They are still considered to be two elements, even though they look like one. What separates them is that they are defined by different vertices. They do not share any vertices. In order to make them one element we would need to “Merge” (or weld, or collapse, as it is sometimes referred to) the two vertices. Each place where the triangles seemed to touch one another, we would make sure there was only one vertex. Then the two triangles would share the vertices, and they would be one element. Usually, modeling software keeps your objects as one element most of the time, automatically sharing vertices when you extend the surface of you model.

PolygonModeling-Fig5-SeperateElement.png PolygonModeling-Fig5-OneElement.png

Polygons that are not connected to an element, are not “continous” with it. This is difficult to understand on paper. Work with in in the software.

Elements are useful in selecting groups of polygons at a time in objects where several distinct surfaces exist. In 3DSMAX you can choose element mode in an editable mesh, and select the element. In Maya you can select Elements by extending the selection as far as it will go.

[edit] Review: The components of a polygonal (or “mesh”) model

These features are called “sub-objects” In 3DSMAX and “components” in Maya.

Vertex 
A point, in a place. A vertex in perfectly small. In has no width, length or height. It just has a position. A vertex by itself is useless. It is useful when combined with other things. If we create several verticies we can start connecting them to make visible surfaces.
Edge 
One side of a polygon or triangle. If you move an edge, the two vertices that define that side of the polygon or triangle will really be moved.
Triangle
A triangle is defined by 3 vertices. I could say that vertex 1 vertex 2 and vertex 3 make a triangle. That would give me a surface.
The area inside the triangles borders, is also part of the triangle. The triangle is a surface. A triangle can be rendered, and would appear solid.
Polygon
Polygons are like triangles but have more sides than three. Polygons are really made up of several triangles. Usually the software lets you deal with the polygons without having to worry about the triangles. It worries about the triangles itself. You don’t have to define each triangle separately. You can just deal with polygons and usually software will figure out how to work the triangles itself. For some advanced modeling purposes, you might one day need to worry about the individual triangle, but it is uncommon.
A three sided polygon is a “tri” a 4 sided polygon is a quad. Well constructed models should generally consist mostly of quads, with a few tris present. If the model is intended to be used for a subdivision surface (a way of rounding models), it should not have polygons with more than 4 sides.
Element (or a “continuous mesh”) 
An element is a collection of polygons which are welded to each other. They share vertices with each other.
Normal 
The normal tell the polygon which side is visible. When backface culling is turned on, you can only see a triangle if it’s normal faces you. Essentially, only one side of the triangle would be visible.