We start as we end, with the coveted polygon, but what is a polygon really?
Sure, most people will call out "A face made out of edges which are made out of vertices" but what is a face? What is an edge? What is a vertex? Taking it further, what's the difference between them and surfaces/curves/points?
I'll be discussing the absolute basics of polygons and how a surprising number of people are mislead by software engineers into a false distinction of many concepts within a program. This should also explain to you what "Vertex angle normals" are, what "hardening normals" means, why do some people use split edge modifier in blender instead of auto smooth, and most importantly, why do both of them give the exact same result in Roblox Studio? These and much more should become obvious in this post
By the end of this read, you should be able to correctly identify what these words really mean, find out how you're really misusing them constantly, how the 'shading' of an object really works, how data might break when writing and reading info from one program to another (like why a model taken out of Roblox is "broken")
A word of warning, the content in this post, aside from the terms, will undoubtedly make more sense to someone with 0 experience than someone experienced, so try to go in assuming no prior knowledge, trust me, it'll confuse you!
Where it all began: Drawing cool images with math
If you're enough of a nerd, you might have seen how some wizards make really interesting shapes in Desmos Graphing Calculator or even on an oscilloscope using curves
Here's an example, this demo is accessible here, feel free to take a look
This, to many people, is totally alien. Some readers might not have even known there are people that draw shapes like that with curves
And for a long time that's what making shapes on a computer was, an esoteric mathematical endeavor
But as a few smart people came to realize, it didn't have to be: if we reduce the shapes we use to straight lines that go from point A to point B, you can take away most of the hard work and thinking, reducing it down to something the average user can do; what a noble concept!
The birth of a digital polygon as we know it
Huzzah, a polygon! put a point anywhere in a virtual 3d space, then your computer will connect specific points in a specific order, forcing mathematical lines that intersect these two points and their domain begins and ends at each intersection
Now, if we enclose a few of these lines and draw their inside as another color, we get a polygon! duplicate the process, adding new unique points that intersect with the old ones to give the illusion of them being connected, now we can color them differently and we have An Shape
Seems simple enough, what do we call these concepts?
Well, we have points, but since most of our designs will look watertight (or in mathematical terms, manifold) we might as well refer to each duplicate, overlapping point as a vertex. Surely, that will not confuse the end user, right?
These lines we draw.. we should differentiate them from more complex mathematical curves (Think a bezier curve!) that use math™ to drive their shape.. Let's call the straight ones an edge and others a curve, sounds simple and sensible, right?
The solid part enclosed between the edges is a surface, but we still need to differentiate more complex mathematical 3d enclosed shapes (Like the potato chip down below) from basic filling.. let's call the simple ones we just did a face, sounds good!
The aforementioned potato chip |
Wait what? The users are confused and are using these terms fluidly without knowing what they mean?
Ok.. some software developers try to clear up the mess by enforcing terms (Like calling points for FX.. points and points for modeling: vertices) but that made the mess worse?
Ok.. No big deal, what if we make a new term for everything like Pixar tried with OpenUSD.. Huh? People don't understand the new terms and are still using the old ones?
...Yeah, humans be humans. For anyone confused, let me explain:
Talking from the perspective of an average 3d modeler, most programs (Blender, Maya, 3ds max, etc) actually do not allow you to modify the vertices (unless you split every single face from one another, but we'll understand why down below), it only exposes points to you that have an automatic amount of vertices glued to them (recall that vertices are just a set of duplicated points in the same space in our terms); This is for simplicity's sake.
If you are still confused, please read below where we look into different ways to expose these vertices, that should clear them up
I can prove to you these hidden vertices exist in two ways:
Firstly, look at this shape: do you see how the transition between each triangle/face is smooth? This has different names in different programs (flat/smooth shading in Blender), but notice the purple lines shooting out of each point. There is only one of them at each point, for a total of 5 purple lines for 5 points
Now, look at the same shape, this time not smooth. Notice how the single point on the top has 4 purple arrows shooting out of it. Why?
Notice what happens when I start isolating the faces one by one. See what happens to the purple lines? each purple line shows the direction of a vertex: each individual triangle has 3 unique vertices and their unique purple arrow is fully perpendicular to the direction of the triangle/face
So for all intents and purposes, whether a mesh appears "smooth" or "flat" depends entirely on how these lines, called Vertex angle normals are angled.
When multiple faces have their shared vertices pointing at the same direction, the transition between them is smoothed out for reasons I might explain in another post
Similarly, whether a face is connected to another face or not is a totally abstract flag/concept. There's simply a line of code saying "By the way, these are totally unrelated edges that happen to overlap and are supposed to be glued to each other, so treat them as such when they are transformed"
Another way to see the vertices has to do with UV maps, if you don't understand what they are yet, no worries, skip this section
For others, if we look at the UVs of the same pyramid object, they look as expected
Now, let's place a random seam and see what happens
Looks as expected, now check this out
I'm syncing my UV selection with my polyedit selection, you can see that a single point in 3d view represents two vertices in the UV editor!
Now, if you're really smart, you might think about how Roblox Studio "Cuts" each mesh that is put in it and then exported back out based on exactly which edge is sharp or UV seamed and wonder if it's for similar reasons
The answer is precisely! Roblox studio is simply cutting them due to the way it's internally coded, otherwise, as far as theoretics go, there's no change made to the mesh in anyway, only how the file output by Roblox is read by other programs
With this knowledge, I can further tell you that a "curve" and an "edge" or a "face" and a "cad surface" are the same thing. That's why you can import a polygonal model inside a CAD program, edges get converted to curves/lines and the faces are converted to surfaces!
No proof for this one, you can test it out yourself if you have the means
You might also now start to understand how "harden normals" or "weighted normals" work, you're just altering the direction of the Vertex angle normals using different methods: as in what algorithm is used to average between them
How will this knowledge help me?
That's the neat part, it won't..
At least not until you start doing serious work and have to make a proper Pipeline™, where you have to understand how different programs read and write data
Nevertheless, it should be the absolute basics of "3d modeling" which seeps into rendering too and every other part of 3d art-ing
As much as many of you will never need to use this information, or potentially didn't know this after decades of experience, god knows I didn't know for many years this will build a foundation for other blogs going forward, for example... Why triangles, quads and Ngons?
As a bonus for anyone reading up to here, just to prove the true chaos, I will show you a little demo that outlines how truly primitive/advanced our method of modeling really is. Please enjoy this video!
Or skip it if it confuses you
Let's process what is happening
- We take a sphere
- Add particles to it that dance around driven by a noise
- We can now add duplicates of these particles and offset their "history", making it seem like there's a trail
Now then is the million dollar question, how do we actually connect these points?
I show a few different examples
In order, we are:
- Giving them a trail, by drawing a curve/edge by a arbitrary attribute
Let us for this attribute, give each point a unique id, and each point which acts as the trail of that point a suffix, so for any given point it would be x.1, x.2, x.3, x.4 to x.n amount of trail points, then we connect them with an edge one by one in order, and we have An Trail! - We can also just give a unique attribute to each point, and give every trail of that point the same attribute, let's say we look at point 2345, each trail of point 2345 is also called point 2345 as far as the software is concerned when looking at that attribute, we can now draw a face/surface and we get the second effect
- We can just give each point a random id and just connect them in order, which gives us the big mess
As far as a program is concerned, we are "modeling" here, there is no distinction between this and polyediting, in fact, I can pause any frame and start "Modeling" on the mesh, for example extrude a random face or move a random vertex point around
Just to drive the point home, the image below shows two models, both with precisely the same point positions and precisely the same amount of triangles/edges, as far as any software is concerned, they are the same model.. just different configuration of edges/faces
In one of them, there's a totally arbitrary method which a person like me have decided for the ordering of the points connecting, the other one uses another totally arbitrary random method to connect them, they are one and the same if not for a few lines of code
Think of a picture. We can take an image of a flower and re arrange every single pixel, as far as our computers are concerned, those images are mostly the same thing, but there is one particular order of those pixels that give "flower". Same is true with all our models! Fortunately, the massive amount of limits software developers have put to prevent us from jumbling our work is so extensive that many people are unaware of such fundamental fact
As the final image to leave you with, I have highlighted each point in cyan then randomized their colors
Then highlighted each vertex and highlighted them in purple
Now you know! This is great, I will most likely reference this post in the future postings
Also.. Vertex is a singular term, the plural is Vertices
Spread the word, vote on what the next topic should be and have a good one!
~ MeowBread
Comments
Post a Comment